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.

Grid Grouping Control New Row Refresh from underlying data source object

Thread ID:

Created:

Updated:

Platform:

Replies:

20723 Oct 24,2004 08:07 AM Oct 24,2004 05:44 PM Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On October 24, 2004 08:07 AM

Hi I''m using the GridGrouping Control and using an IBindingList to attach to the DataSource. When I enter data in col1 of a "*" new row (Record), I update the underlying data object for col2 directly. The value of which should be displayed in col2. However the new row (Record) does not show the updated col2 value which I updated in the underlying data object. How can I get the "*" new row record to be refreshed from the underlying data object, such that when I make changes to the underlying "*" new row Record object, I get the changes reflected in the "*" new row record.

Administrator [Syncfusion]
Replied On October 24, 2004 09:00 AM

Here is a little sample. It calls EndEdit on the AddNewRecord so your can then update it from outside the grid. GGCNewRow_8486.zip

Administrator [Syncfusion]
Replied On October 24, 2004 04:00 PM

Hi Clay, Thanks for getting back so soon, I had a look at your sample, it''s not entirely what I want to do. What I would like to do is have the all the changes to the underlying data object appear on the "*" new row, rather than appear on another row on the grid once the user has pressed enter on the row. I want to be able to see values in dependent cells on the "*" new row and then at the end hit enter to create a new row in the underlying data source. Thanks John

Administrator [Syncfusion]
Replied On October 24, 2004 05:44 PM

Try handling TableControlCurrentCellChanged and add the valuse at that point. Also handle TableControlCurrentCellMoved to reset a bool flag that makes sure you only add the values once. Here are handlers that you can add to the above sample (you also need to subscribe to the two events.)
private bool addedValuesInNewRow = false;
private void gridGroupingControl1_TableControlCurrentCellMoved(object sender, GridTableControlCurrentCellMovedEventArgs e)
{
	if(e.TableControl.CurrentCell.MoveToRowIndex != e.TableControl.CurrentCell.MoveFromRowIndex)
		addedValuesInNewRow = false;
}
private void gridGroupingControl1_TableControlCurrentCellChanged(object sender, GridTableControlEventArgs e)
{
	if(this.gridGroupingControl1.Table.AddNewRecord.IsEditing && !addedValuesInNewRow)
	{
		this.gridGroupingControl1.Table.AddNewRecord.SetValue("Col2", r.Next(1000)); 
		this.gridGroupingControl1.Table.AddNewRecord.SetValue("Col3", r.Next(1000)); 
		this.gridGroupingControl1.Refresh();
		addedValuesInNewRow = true;
	}
}

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.

;