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

Add Column to GDBG

Hi,
how to add a column to a gdbg bounded with a datatable ?

thanks

1 Reply

AD Administrator Syncfusion Team October 30, 2006 04:34 AM UTC

Hi Simon,

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

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();

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon