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.

Grouping combo cell subset parent

Thread ID:

Created:

Updated:

Platform:

Replies:

100872 Sep 11,2011 12:42 PM Sep 12,2011 12:21 PM Windows Forms 4
loading
Tags: Grouping
muii
Asked On September 11, 2011 12:42 PM

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


Ragamathulla B [Syncfusion]
Replied On September 12, 2011 03:09 AM

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.


muii
Replied On September 12, 2011 12:21 PM

so it works perfect
thanks


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.

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.

;