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
close icon

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 12:47 PM UTC

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 01:31 PM UTC

I meant Dim grid As GridControlBase = e.TableControl Stefan

BS Bhandhavi Sangaru July 29, 2004 02:39 PM UTC

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

Live Chat Icon For mobile
Up arrow icon