Grouping combo cell subset parent

Working with Visual Studio 2008 (VB)
Sql Server 2008


I have 4 tables.

people
idPeople
name
idStreet
idArea

streets
idStreet
name
idDistrict

District
idDistrict
name

area
idArea
name
idDistrict



I have this grid grouping control

+ [street name 1] [district name 1]
[people name 1] [area name 1]
[people name 2] [area name 2]
+ [street name 2] [district name 2]
[people name 3] [area name 3]
[people name 4] [area name 4]

The [district name] is a combo of the table 'district'
The [area name] is ​​a combo of table 'area', but only to show the areas related to their district.

How I can do that?
How I can set the DataSource of the column [area name] to display a filtered subset of [district name]?

Sorry for my English


4 Replies



RB Ragamathulla B Syncfusion Team September 12, 2011 07:09 AM UTC

Hi Imc,

Thank you for your interest in sycnfusion products.

You can bind the datasource dynamically using TableControlCurrentCellShowingDropDown event. The following code explains same.

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.
}
}

Let me know if you have further concerns.

Regards,
Ragamathullah B.



MU muii September 12, 2011 04:21 PM UTC

so it works perfect
thanks


Loader.
Up arrow icon