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.

get changed values in a row at the RowSaved event

Thread ID:

Created:

Updated:

Platform:

Replies:

69921 Nov 17,2007 08:09 AM Nov 29,2007 04:29 AM Windows Forms 5
loading
Tags: GridControl
Martin
Asked On November 17, 2007 08:09 AM

Hello @ all
how can i get the changes values in a row,
i search for a methode these give me the changes back.
example:
Name Street City
First Test Teststr. Munich
Change Test Secondstr. Munich
------------------------------------
Diff to Save Secondstr.

regards Martin


Administrator [Syncfusion]
Replied On November 19, 2007 07:12 AM

Hi Martin,

Thank you for your interest in Syncfusion products.

Getting changed values in a row.

You can get the changed values in a row using TableControlCurrentCellEditingComplete or RecordValueChanged events of GridGroupingControl.

The following code snippet illustrates this.

Method I

[C#]
private void gridGroupingControl1_TableControlCurrentCellEditingComplete(object sender, GridTableControlEventArgs e)
{
Element el = e.TableControl.Table.DisplayElements[this.gridGroupingControl1.TableControl.CurrentCell.RowIndex];
if (el.Kind == DisplayElementKind.Record)
{
Record r = el.ParentRecord;
MessageBox.Show(r.ToString());
}
}

Method II
[C#]
private void gridGroupingControl1_RecordValueChanged(object sender, RecordValueChangedEventArgs e)
{
Record r = e.Record;
MessageBox.Show(r.ToString());
}

Here is a sample for your reference.

http://websamples.syncfusion.com/samples/Grouping.Windows/F69921/main.htm

Please let me know if you have any other queries.

Regards,
Jaya


Martin
Replied On November 25, 2007 07:49 AM

Hi Jaya,
thanks you for yours answer.
but this is not solution for my problem.
I use the "RowSaved"-Event in the Bounded Grid
like this:

Private Sub HauptGrid_RowSaved(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridRowEventArgs) Handles HauptGrid.RowSaved
If e.IsAddNew = False Then
For ColNo As Int32 = 1 To Grid.Model.ColCount
Grid.Model(e.RowIndex, ColNo).......?????????
Next
End If
End Sub

I need a methode, that give me the changes in each Cell, like this
If Grid (Row,Col).IsChanged Then
Debug.Print( Grid (Row,Col).Value)
End If

Please give me a solution.
Martin


Administrator [Syncfusion]
Replied On November 26, 2007 02:31 AM


Hi Martin,

Thanks for the update.

Retrieving row changes in DataBoundGrid

Please use the below code snippet to retrieve the changes done in each cell of the changed row in RowSaved event handler.

Private Sub gridDataBoundGrid1_RowSaved(ByVal sender As Object, ByVal e As GridRowEventArgs)
If e.IsAddNew = False Then
Dim cm As CurrencyManager = CType(Me.BindingContext(Me.gridDataBoundGrid1.DataSource, Me.gridDataBoundGrid1.DataMember), CurrencyManager)
Dim drv As DataRowView = CType(cm.Current, DataRowView)
Dim dr As DataRow = CType(drv.Row, DataRow)

For i As Integer = 0 To 2
Console.WriteLine(drv(i).ToString())
Next i
End If
End Sub

Here is a sample for your reference.

http://websamples.syncfusion.com/samples/Grid.Windows/F69921/DataboundGrid/main.htm

Please let me know if this helps.

Regards,
Jaya


Martin
Replied On November 28, 2007 01:57 PM

Hi Jaya,
thanks you for yours another answer.

Yes this looks good, but I still have one question, I need only the changed values.
It is, possible that I get only this changed values?

Thanks
best regards Martin





Administrator [Syncfusion]
Replied On November 29, 2007 04:29 AM

Hi Martin,

Thanks for the update.

There is no direct such method to retrieve only the changed values in a cell. But as a workaround, you can compare the saved values with old values and extract the modified data using String manipulations.

Please let me know if you have any other queries.

Regards,
Jaya


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.

;