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.

GetChanges from the GroupingGridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

29597 May 30,2005 08:08 AM Jun 1,2005 05:36 AM Windows Forms 4
loading
Tags: GridControl
Prathima Venkobachar
Asked On May 30, 2005 08:08 AM

Hi, If the user modifies data in the grid,I want to get modified rows. I am trying to get delta of the datatable bound to the GroupingGridControl. dt is a datatable, it is declared as a member variable to the class. I am using DataTable dtt = dt.GetChanges(DataRowState.Modified); But is returning undefined value. Thx, Prathima

Administrator [Syncfusion]
Replied On May 30, 2005 09:00 AM

Are you leaving the changed row before you call GetChanges? The changes are only committed to the datasource when you leave the row. If you want to catch the changes on the current row, you can try calling the Validate method on the form before your GetChanges call.
private void button1_Click(object sender, System.EventArgs e)
{
	this.Validate();
	DataTabel t2 =	dt.GetChanges(DataRowState.Modified);
	if( t2 != null)
	{
		Console.WriteLine(t2.Rows.Count);
	}
}

Prathima Venkobachar
Replied On June 1, 2005 12:35 AM

Hi, I am attaching the sample I hv tried.Pl have a look at it. Thx, prathima >Are you leaving the changed row before you call GetChanges? The changes are only committed to the datasource when you leave the row. > >If you want to catch the changes on the current row, you can try calling the Validate method on the form before your GetChanges call. >
>private void button1_Click(object sender, System.EventArgs e)
>{
>	this.Validate();
>	DataTabel t2 =	dt.GetChanges(DataRowState.Modified);
>	if( t2 != null)
>	{
>		Console.WriteLine(t2.Rows.Count);
>	}
>}
>
GGC_MoveCOlumns_8e767f4c1_1090.zip

Administrator [Syncfusion]
Replied On June 1, 2005 05:23 AM

In that sample, the Datatable was created dynamically with all the rows being added new. And DataTable.AcceptChanges was not called. So, the RowState for all the rows is Added, and will remain so event if you modify some rows. That is why GetChanges(Modified) is coming back empty in the sample code. So, try either adding the DataTable.AcceptChanges call so all rows will start out unmodified, or using GetChanges(Added) to get the changes.

Prathima Venkobachar
Replied On June 1, 2005 05:36 AM

Thx for the reply. I used DataTable.AcceptChanges() and GetChanges(Modified). It works fine. But if I use GetChanges(Added)..it doesn''t work. Anyway what I need is working. Thx again. Prathima >In that sample, the Datatable was created dynamically with all the rows being added new. And DataTable.AcceptChanges was not called. So, the RowState for all the rows is Added, and will remain so event if you modify some rows. That is why GetChanges(Modified) is coming back empty in the sample code. So, try either adding the DataTable.AcceptChanges call so all rows will start out unmodified, or using GetChanges(Added) to get the changes.

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.

;