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.

add aditional column

Thread ID:

Created:

Updated:

Platform:

Replies:

31640 Jul 12,2005 04:04 AM Jul 12,2005 04:53 AM Windows Forms 1
loading
Tags: GridControl
Hrvoje Voda
Asked On July 12, 2005 04:04 AM

When I fill a grid with data from dataset, and then I want to add some more data, and ofcourse in new columns, grid erase my previous data and put that new data instead. Why? How can I prevent this?

Administrator [Syncfusion]
Replied On July 12, 2005 04:53 AM

Are you trying to add new columns to your DataTable that is the grid''s DataSource? Or, are you trying to add unbound columns where the data does not come from the DataTable that is the grid''s DataSource? Here is button handler code that does adds a column to an existing DataTable.
private void button1_Click(object sender, System.EventArgs e)
{
	//dt is the grid''s DataSource
	dt.Columns.Add("newcolumn");
	this.gridDataBoundGrid1.Binder.InitializeColumns();
	this.gridDataBoundGrid1.Refresh();
}
To use an unbound column, you add a GridBoundColumn with a name that is not a column in the DataSource. Then you handle QueryCellInfo and SaveCellInfo to provide and save teh unbound values for this column. This sample has unbound columns in it. \Syncfusion\Essential Studio\3.2.1.0\Windows\Grid.Windows\Samples\DataBound\GDBGMultiHeader

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.

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.

;