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.
Syncfusion Feedback

Attaching row?

Thread ID:

Created:

Updated:

Platform:

Replies:

34078 Sep 1,2005 01:56 PM UTC Sep 2,2005 03:54 PM UTC Windows Forms 3
loading
Tags: GridControl
Virgil
Asked On September 1, 2005 01:56 PM UTC

When the GDBG is allowed to have a new row added, that row remains detached until the user leaves the row. This is causing me much grief in getting the grid to refresh properly when attempting to manipulate the datarow. Is there a way to force the detached row to be added to the table? Thanks, Virgil

Virgil
Replied On September 1, 2005 02:25 PM UTC

Side question. Are Binder.DirectSaveCellInfo and Binder.DefaultCurrentRecordItemChangedBehavior = GridCurrentRecordItemChangedBehavior.ReloadCurrentRecord opposites?

Administrator [Syncfusion]
Replied On September 1, 2005 04:02 PM UTC

I am not sure if this is what you want, but you can handle the RowEnter event and if you are entering the AddNewRow, go ahead and add a new row yourself.
private void gridDataBoundGrid1_RowEnter(object sender, GridRowEventArgs e)
{
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
	if(e.RowIndex == this.gridDataBoundGrid1.Model.RowCount)
	{
		DataTable dt = this.gridDataBoundGrid1.DataSource as DataTable;
		dt.Rows.Add(dt.NewRow());
	}
}
I would not exactly say those two properties are opposite. DefaultCurrentRecordItemChangedBehavior controls what happens if you are actively editing a grid cell, and something outside the grid changes the IBindingList datasource. DirectSaveCellInfo = true raises an IBindingList ItemChanged event each time you change cells even if you are moving in the same row. The default behavior is to only rasie the event when the position in the data list changes.

Virgil
Replied On September 2, 2005 03:54 PM UTC

This seemed to work for me: GridDataBoundGrid1.CommitChanges() One that happened, I could work directly with the datarow and things would appear properly on the grid.

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

;