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.

Adding dynamic datasource to dynamic Combobox''s in Grid Control

Thread ID:





60914 May 15,2007 07:52 AM May 17,2007 01:36 PM Windows Forms 3
Tags: GridControl
Asked On May 15, 2007 07:52 AM


I have a grid Control, I would like to dynamically add rows(on a event) in a grid, in which two of the columns contain comboboxes, If i change the selection of one combobox, I would like to dynamically bind the other combobox (based on the selection). Could you please show hw this possible in the Syncfusion grid and give some pointers towards the same.

Thanks in Advance.

Raul D'souza

haneefm [Syncfusion]
Replied On May 15, 2007 12:04 PM

Hi Rahul,

If you wan to change the datasource for the specific cell based on some condition then handle the CurrentCellShowingDropDown event to place your new datatable directly into the GridComboBoxCellRenderer.ListBoxPart. This will affect the dropped cell datasource. Please refer to the attached sample for implementation and let me know if this helps.

Sample : ComboxDatasource.zip

Also refer the below KBs for more information.

Best regards,

Replied On May 17, 2007 12:50 PM

hey Haneef,

Thanks a lot for your help, However I am a newbie to Syncfusion grid and would also like to know hw do I add a new row in DGBG?

haneefm [Syncfusion]
Replied On May 17, 2007 01:36 PM

Hi Rahul,

Thank you for your update.

Issue 1: showing AddNewRow..

If you want to to show the extra row( Addnew row ) in a grid, you can set the EnableAddNew property to True.

this.gridDataBoundGrid1.EnableAddNew = false;

Issue 2: adding a new row.

To add or remove rows in a grid, you just do it by working with the underlying datasource. The grid should automatically reflect the changes. Here is a code snippet that show this.

DataTable dt = this.gridDataBoundGrid1.DataSourec as DataTable.
DataRow dr = dt.NewRow();
dr[0] = "NewRow";

Best regards,


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.