Articles in this section

How to the get the record details in WinForms GridGroupingControl?

Getting the record details


If you want to get the record ID, you need to use the Record class. To get all the records (say previous, current and next) while add or remove or edit, you need to use SourceListRecordChanged event. This event occurs when record in the underlying data source is added or removed or changed.

If you want to restrict the event only for adding new record you can validate using Syncfusion.Grouping.RecordChangedType.

 

C#

//Event Handler
this.gridGroupingControl1.SourceListRecordChanged += gridGroupingControl1_SourceListRecordChanged;
 
void gridGroupingControl1_SourceListRecordChanged(object sender, Syncfusion.Grouping.RecordChangedEventArgs e)
{
     if (e.Action == Syncfusion.Grouping.RecordChangedType.Added) //Only for new record added
     {
        ExistingRecordId = e.Record.GetPreviousRecord().Id; //Existing record id.
        NewRecordID = e.Record.Id;//New record id
        MessageBox.Show("New record ID: " + NewRecordID + "\tExisting record ID: " + ExistingRecordId);
     }
} 

VB

' Event Handler
AddHandler gridGroupingControl1.SourceListRecordChanged, AddressOf gridGroupingControl1_SourceListRecordChanged

Private Sub gridGroupingControl1_SourceListRecordChanged(ByVal sender As Object, ByVal e As Syncfusion.Grouping.RecordChangedEventArgs)
    If e.Action = Syncfusion.Grouping.RecordChangedType.Added Then ' Only for new record added
        ExistingRecordId = e.Record.GetPreviousRecord().Id ' Existing record ID
        NewRecordID = e.Record.Id ' New record ID
        MessageBox.Show("New record ID: " & NewRecordID & vbTab & "Existing record ID: " & ExistingRecordId)
    End If
End Sub

Record details are shown in the screenshot below

Show the record details in GridGroupingControl

Samples:

C#RecordDetails_CS

VBRecordDetails_VB

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied