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.

How do I fix the DataSource of one ComboBox cell depending upon the value of another binded column

Thread ID:

Created:

Updated:

Platform:

Replies:

94543 May 19,2010 01:13 PM May 25,2010 07:47 AM ASP.NET Web Forms (Classic) 3
loading
Tags: GridGroupingControl
Yoan
Asked On May 19, 2010 01:13 PM

I'm using a GridDataBoundGrid with 2 columns A and B

The A column is composed of static cells and contains several value

The B column is composed of combobox cells whoses values depands on the A column

>> during the data binding, how do i fix the datasource of my combobox cells depending on the value in the A column ?

Thanks

Yoan

Christopher Issac Sunder K [Syncfusion]
Replied On May 21, 2010 10:49 AM

Hi Yoan,

Thank you for your interest in Syncfusion products.

Your mentioned query about “DataSource of one ComboBox cell depending upon the value of another binded column in GridDataBoundGrid” can be achieved by handling the “QueryCellInfo” event with the following code. This “QueryCellInfo” event raises event time when a small changes has been done.

if (e.ColIndex == 2 && e.RowIndex>0)
{
e.Style.CellType = "ComboBox";
e.Style.ChoiceList = null;
string sno = this.gridDataBoundGrid1.Model[e.RowIndex, 1].CellValue.ToString();
switch (sno)
{
case "1":
e.Style.DataSource = GetTable1();
e.Style.DisplayMember = "StudentID";
e.Style.ValueMember = "StudentID";
break;
:
:
}
}


Please refer the following sample which illustrates the behavior of dataBinding in GridDataBoundGrid.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=F945431543083699.zip


Let me know if you have any further concerns.

Regards,
Christopher K.

Yoan
Replied On May 25, 2010 04:00 AM

ok, thanks

Christopher Issac Sunder K [Syncfusion]
Replied On May 25, 2010 07:47 AM

Hi Yoan,

Thanks for the update.

Regards,
Christopher K.

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.

;