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

Add more columns Dynamically to a GDBG

Thread ID:

Created:

Updated:

Platform:

Replies:

62208 Jun 11,2007 06:12 AM UTC Jun 11,2007 03:44 PM UTC WinForms 1
loading
Tags: GridControl
Anika kapoor
Asked On June 11, 2007 06:12 AM UTC

Hi

I want to add some more columns dynamically to an already binded databound grid, please let me know how can i implement this.

Regards,
Anika

haneefm [Syncfusion]
Replied On June 11, 2007 03:44 PM UTC

Hi Anika,

Add BoundColumn to the Grid:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

To add the column to your grid, you just do it by working with the underlying data source.Below is a code snippet

DataTable dt = this.gridDataBoundGrid1.DataSource as DataTable;
this.gridDataBoundGrid1.BeginUpdate();
dt.Columns.Add();
this.gridDataBoundGrid1.EndUpdate(true);
this.gridDataBoundGrid1.Refresh();

Add UnboundColumn ( it doesn't related to the datatable) :
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
You can add an unbound column to the grid, and then use the grid.Model.QueryCellInfo and SaveCellInfo events to provide and save the unbound values for this column.

Please refer to the KB article link below for a sample on this.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=305

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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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

;