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

dynamic datasource for combo in ggc 2.1.0.9

i have a ggc, there is a column of celltype = combo. this combo is attached with a datasource. i know that i can set the datasource like this: Me.ggc.TableDescriptor.Columns("NameofFamilyMember").Appearance.AnyRecordFieldCell.DataSource = dtbl but how do i set a different datasource for each record shown? for example, each record shows a family, the combo will be used to show its own family member list.

1 Reply

AD Administrator Syncfusion Team January 7, 2005 01:49 AM

You can try handling the TableControlCurrentCellShowingDropDown event. There, try dynamically setting the DataSource on the dropdown.
private void gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)
{
	GridCurrentCell cc = e.TableControl.CurrentCell;
	GridComboBoxCellRenderer renderer = cc.Renderer as GridComboBoxCellRenderer;
	if(renderer != null)
	{
		GridComboBoxListBoxPart listBoxPart = (GridComboBoxListBoxPart)renderer.ListBoxPart;
		// now conditionally set listBoxPart.DataSource
		listBoxPart.DataSource = SomeDataSourceYouWantToSet.
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon