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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

60914 May 15,2007 11:52 AM UTC May 17,2007 05:36 PM UTC WinForms 3
loading
Tags: GridControl
Raul
Asked On May 15, 2007 11:52 AM UTC

hi,

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 04:04 PM UTC

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.
http://www.syncfusion.com/Support/article.aspx?id=567
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=115&catId=12

Best regards,
Haneef

Raul
Replied On May 17, 2007 04:50 PM UTC

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 05:36 PM UTC

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.

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

Best regards,
Haneef

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.

Warning Icon 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.Close Icon

;