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
close icon

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

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

3 Replies

CI Christopher Issac Sunder K Syncfusion Team May 21, 2010 02:49 PM UTC

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.


YO Yoan May 25, 2010 08:00 AM UTC

ok, thanks


CI Christopher Issac Sunder K Syncfusion Team May 25, 2010 11:47 AM UTC

Hi Yoan,

Thanks for the update.

Regards,
Christopher K.

Loader.
Live Chat Icon For mobile
Up arrow icon