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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GGC dynamically setting datasource for GridListControl CellType

Thread ID:

Created:

Updated:

Platform:

Replies:

41028 Feb 20,2006 11:20 PM UTC Feb 21,2006 05:46 PM UTC Windows Forms 2
loading
Tags: GridControl
Chris Victory
Asked On February 20, 2006 11:20 PM UTC

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?

Administrator [Syncfusion]
Replied On 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.

Chris Victory
Replied On 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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;