We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Getting error when trying to set the dropdownrows in Grouping Grid.

Private Sub myGroupingGrid_TableControlCurrentCellShowingDropDown(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellShowingDropDownEventArgs) Handles myGroupingGrid.TableControlCurrentCellShowingDropDown Dim grid As GridControlBase = CType(sender, GridControlBase) Dim cc As GridCurrentCell = CType(grid.CurrentCell, GridCurrentCell) Dim cr As GridDropDownGridListControlCellRenderer = CType(cc.Renderer, GridDropDownGridListControlCellRenderer) CType(cr.ListControlPart, GridDropDownGridListControlPart).DropDownRows = 10 End Sub I am using the above code to set the number of dropdownrows of my GridListControl in a GroupingGrid. I used the same code for GridListControl in GridDataboundGrid and it worked. I am getting an invalid Cast at line Dim grid As GridControlBase = CType(sender, GridControlBase) Please help! Thanks, Bhandhavi.

3 Replies

AD Administrator Syncfusion Team July 29, 2004 07:47 AM

Hi Bhandhavi, the sender will be of type GridGroupingControl. Use Dim grid As GridControlBase = e.Inner.TableControl instead. Stefan


AD Administrator Syncfusion Team July 29, 2004 08:31 AM

I meant Dim grid As GridControlBase = e.TableControl Stefan


BS Bhandhavi Sangaru July 29, 2004 09:39 AM

Stefen, Thanks a lot. It worked perfectly. Bhandhavi.

Loader.
Live Chat Icon For mobile
Up arrow icon