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

GGC dynamically setting datasource for GridListControl CellType

In my GGC I have a column that I want to display a GridListControl in utilizing a dynamic collection of data. I''m using the TableControlCurrentCellShowingDropDown to set the datasource but the control does not show when I click the dropdown even though the objects are populated. I dried this code with the dropdown and it works fine. private void wgcAttributes_TableControlCurrentCellShowingDropDown( object sender, GridTableControlCurrentCellShowingDropDownEventArgs e ) { selectedAttribute.selected = 1; GridComboBoxCellRenderer cr = (GridComboBoxCellRenderer)e.TableControl.CurrentCell.Renderer; cr.ListBoxPart.DataSource = selectedAttribute.AttributeValues; cr.ListBoxPart.DisplayMember = ReportAttributeValue.FieldNames.Name; cr.ListBoxPart.ValueMember = ReportAttributeValue.FieldNames.Name; } However the code for the list control will not display the dropdown list control. Here is the code. private void wgcFiltering_TableControlCurrentCellShowingDropDown( object sender, GridTableControlCurrentCellShowingDropDownEventArgs e ) { selectedFilter.selected = 1; GridDropDownGridListControlCellRenderer cr = (GridDropDownGridListControlCellRenderer)e.TableControl.CurrentCell.Renderer; cr.ListControlPart.DataSource = selectedFilter.FilterValues; cr.ListControlPart.DisplayMember = ReportFilterValue.FieldNames.Name; cr.ListControlPart.ValueMember = ReportFilterValue.FieldNames.Value; } When I add a regular GridListControl to the form and set it''s datasource property it works fine as well. Am I missing something or should I try a different approach?

2 Replies

AD Administrator Syncfusion Team February 21, 2006 06:08 AM UTC

Hi Chris, Try setting the data source in the gridGroupingControl1_TableControlCurrentCellActivated event handler to see if that helps. Below is a code snippet. private void gridGroupingControl1_TableControlCurrentCellActivated(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlEventArgs e) { GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell; GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer; cr.ListControlPart.DataSource = //set data source ........... ........... } } Regards, Calvin.


CV Chris Victory February 21, 2006 05:46 PM UTC

Thanks, that worked. >Hi Chris, > >Try setting the data source in the gridGroupingControl1_TableControlCurrentCellActivated event handler to see if that helps. Below is a code snippet. > >private void gridGroupingControl1_TableControlCurrentCellActivated(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlEventArgs e) > { > GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell; > > GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer; > >cr.ListControlPart.DataSource = //set data source > ........... > ........... > > } > > } > > >Regards, >Calvin.

Loader.
Live Chat Icon For mobile
Up arrow icon