Telerik Forums
UI for WinForms Forum
2 answers
274 views

hi 

 

i have a problem i want save my data from gridview to dabase including update, deleting a row and adding a row

i populate radgridview from a datatable.

 

my delete button is click event on a image 

and my addnew row is the button from da radgridview

the add new row works almost fine (the click event are not firing on the images.) but add the row to the database.

the delete "button" remove the row from datagrid but is not working removing from the database only radgrid,

is there way i can add delete and update radgridview and then i press a button and update the database?

 

 

 

Pedro Filipe
Top achievements
Rank 1
 answered on 11 Jan 2019
3 answers
74 views

Hello,
There are 3 hierarchical levels in my grid. I use "Load-on-Demand" method to load hierarchical data. Mastertemplate data is binding to a local collection.

My gridview is built basically like this :
   Private Sub FrmMain_Load(sender As Object, e As EventArgs)

        myGridView.MultiSelect = True
        myGridView.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill
        myGridView.ReadOnly = True
        myGridView.AllowRowResize = False
        myGridView.MasterTemplate.SelectionMode = GridViewSelectionMode.FullRowSelect
        myGridView.UseScrollbarsInHierarchy = True
        myGridView.MasterTemplate.ShowChildViewCaptions = True
        myGridView.MasterTemplate.ShowRowHeaderColumn = False

        Call Load_Hierarchy()

        AddHandler myGridView.RowSourceNeeded, AddressOf myGridView_RowSourceNeeded

        myBase.Charge()

        myGridView.DataSource =myBase

   End Sub

   Private Sub Load_Hierarchy()

       Dim template_FirstLevel As New GridViewTemplate()
        template_FirstLevel .Caption = "FirstLevel"
        template_FirstLevel .AllowAddNewRow = False
        template_FirstLevel .AllowDeleteRow = False
        template_FirstLevel .AllowEditRow = False
        template_FirstLevel .AllowRowResize = False
        template_FirstLevel .AutoGenerateColumns = False
        template_FirstLevel .AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill
        template_FirstLevel .ShowChildViewCaptions = True
        template_FirstLevel .ShowRowHeaderColumn = False
        Dim gCol_1 As GridViewTextBoxColumn = New GridViewTextBoxColumn("Col1")

        Dim gCol_2 As GridViewTextBoxColumn = New GridViewTextBoxColumn("Col2")        

        template_FirstLevel.Columns.AddRange(New GridViewDataColumn() {gCol_1, gCol_2})
        myGridView.MasterTemplate.Templates.Add(template_FirstLevel )
        template_FirstLevel.HierarchyDataProvider = New GridViewEventDataProvider(template_FirstLevel)

        '-------------------definition of Second Level template
        Dim template_2ndLevel As New GridViewTemplate()
        template_2ndLevel.Caption = "Second Level"
        template_2ndLevel.AllowAddNewRow = False
        template_2ndLevel.AllowDeleteRow = False
        template_2ndLevel.AllowEditRow = False
        template_2ndLevel.AutoGenerateColumns = False
        template_2ndLevel.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill
        template_2ndLevel.ShowChildViewCaptions = True
        template_2ndLevel.ShowRowHeaderColumn = False
        Dim gCol_2nd1 As GridViewTextBoxColumn = New GridViewTextBoxColumn("Index")
        Dim gCol_2nd2 As GridViewTextBoxColumn = New GridViewTextBoxColumn("Name")
        template_2ndLevel.Columns.AddRange(New GridViewDataColumn() {gCol_2nd1 , gCol_2nd2})
        template_FirstLevel.Templates.Add(template_2ndLevel)
        template_2ndLevel.HierarchyDataProvider = New GridViewEventDataProvider(template_2ndLevel)

   End Sub

   Private Sub myGridView_RowSourceNeeded(sender As Object, e As GridViewRowSourceNeededEventArgs)
        If e.ParentRow.HierarchyLevel = 0 Then '----First Level data load
            Dim Masteritem As C_dbProduit = TryCast(e.ParentRow.DataBoundItem, C_Master)

                    ------Do something to load data in FirstLevelItemsList by using Masteritem-------
                    For 1stItem fonction In FirstLevelItemsList
                        Dim row_1stL As GridViewRowInfo = e.Template.Rows.NewRow()
                        row_1stL.Cells("Col1").Value = 1stItem.data1
                        row_1stL.Cells("Col2").Value = 1stItem.data2                        
                        e.SourceCollection.Add(row_1stL)
                    Next

        End If

        If e.ParentRow.HierarchyLevel = 1 Then '----2nd Level data load
                Dim 1stItem As C_1stItem = TryCast(e.ParentRow.DataBoundItem, C_1stItem)

                Dim masterparentRow As GridViewRowInfo = TryCast(e.ParentRow.Parent, GridViewRowInfo)
                Dim masteritem As C_Master = TryCast(parentRow.DataBoundItem, C_Master)

                If 1stItem Is Nothing Then '-----------------e.ParentRow.DataBoundItem is always nothing
                       Exit Sub
                End If

                If masteritem Is Nothing Then'-----------------e.ParentRow.Parent.DataBoundItem is always Correct!
                       Exit Sub

                End If

                '------------Do something to load data in the collection of 2ndItem by using 1stItem-------

        End If

    End Sub

It works perfect to show mastertemplate and 1st hierarchical level. But when I expand 2nd level, its ParentRow.DataBoundItem (it should be selected 1st level data) is always nothing. But I can get DataBoundItem of e.ParentRow.Parent correctly.

In order to avoid memory overloading, I prefer load-on-demand method in hierarchy grid.

Please help me.

Thank you

Hristo
Telerik team
 answered on 11 Jan 2019
1 answer
56 views
Is it possible to replace the default isolated storage custom dictionary with another custom dictionary for all instances of RadSpellChecker? 
Dess | Tech Support Engineer, Principal
Telerik team
 answered on 10 Jan 2019
2 answers
92 views

Hello, administrator

As you know,I used the following code to export the data in the table, but how can I export the data to any location on the computer and name it instead of having to change it when the code is written

    Dim spreadExporter As GridViewSpreadExport = New GridViewSpreadExport(radGridView1)

    Dim exportRenderer As New SpreadExportRenderer()

    spreadExporter.RunExport("D:\exportedFile.xlsx", exportRenderer)

Looking forward to your reply

Ricardo
Top achievements
Rank 1
 answered on 10 Jan 2019
3 answers
164 views

I've spent 2 hours trying to get the colors right on a GridView......

I set the selected row color using your examples, and the RowFormatting event, but there are two colors i just can't seem to set:

- the color used when the mouse moves over a row. I've tried using the CellMouseMove (as your examples) but I them have to rest all the non-current cells back to normal, and this seems very complicated for just changing a simplecolor. Can I set this at design time? If not, how at runtime?

- same for the backcolor of the whole grid: there is a design0time BackColor on the RadRootElement, and this sometimes shows up in the designer, but not reliably. And I can't seem to set it at runtime either.

Thanks for the great support!

Ian

 

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 Jan 2019
5 answers
111 views

hi

i want square and multiplied shape for ScatterLineSeries point.

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 Jan 2019
4 answers
632 views

Hi,

I've got a RadTextBox which has multiline set to true. However, when I assign a value to the Text property which contain "\n" characters all text appears on a single line. Is the Text property supposed to handle multi line texts, or do I need to set some additional properties?

Hristo
Telerik team
 answered on 09 Jan 2019
7 answers
481 views

Hi,

When I click the button element of the RadSplitButtonElement, the dropdown do open and fire click.

Like in MS-Office, I expect the button to fire click, but not open the dropdown. The dropdown should only be opened when clicking the arrow part.

Note : I'm using version 2016.3.1024.40

How can I change this behavior ?

Thanks

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 09 Jan 2019
8 answers
146 views

Hello,

At this moment, when using a touchscreen, a pangesture on the scrollbar, that's on the bottom of the Panorama results in a pangesture event.

Is it possible that this pangesture ON THE SCROLLBAR controls the scrollbar?

(see video : http://www.soundware.nl/Data/20190103_161853.mp4)

The pangesture on the rest of the Panorama-control needs to be intact.

Best regards

Patrick Vossen

Hristo
Telerik team
 answered on 09 Jan 2019
3 answers
111 views

Is it just me?

Standard Winforms app.  I have used the Visual Style builder to create a custom theme and saved it as 'UVTMetroBlue.tssp', in a sub=folder of my project named 'Theme'.

In Visual Studio 2017 I add the theme package as a resource.  I go to the RadThemeManger on my MainForm, and select load from resource. It prompts me to enter the resource location string.

If I enter what I believe is the correct string : "UVTMain.Theme.UVTMetroBlue.tssp", I get a null reference error. If I add it through 'Edit Themese', and browse to the file, same "null reference" error.

 

If I put in nonsense, it accepts it without error.

So, I go to 'Edit Themes' on the Theme Manager and there is the entry

Unable locate Resource file 'aasdasdasd' in the project folder 'C:\Users\hespect\source\Workspaces\UVeritech\UVTMain\UVTMain\'

 

Is something wrong with my .tssp file?

 

 

 

Dimitar
Telerik team
 answered on 09 Jan 2019
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
ColorBox
Callout
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
DateOnlyPicker
TimeOnlyPicker
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?