Articles in this section
Category / Section

How to identify a record in WinForms GridGroupingControl?

1 min read

Identify a record

There are several ways to identify a record in the WinForms GridGroupingControl. To identify the record from the GridStyleInfo class, you can use the GridTableCellStyleInfoIdentity. GridTableCellStyleInfoIdentity defines the inheritance of the style properties for each element in the Grid. Each GridStyleInfo object has a CellIdentity of its own that contains the record for that particular object. This record can be extracted with the help of the DisplayElement.GetRecord() method from that object.

C#

GridStyleInfo style = this.gridGroupingControl1.TableControl.GetViewStyleInfo(8, 3);
GridTableCellStyleInfoIdentity id = style.CellIdentity as GridTableCellStyleInfoIdentity;
Record record;
if(id.DisplayElement.IsRecord())
{
   record = id.DisplayElement.GetRecord();
   MessageBox.Show(record.Info, "5th Record Values");
}

VB

Dim style As GridStyleInfo = Me.gridGroupingControl1.TableControl.GetViewStyleInfo(8, 3)
Dim id As GridTableCellStyleInfoIdentity = TryCast(style.CellIdentity, GridTableCellStyleInfoIdentity)
Dim record As Record
If id.DisplayElement.IsRecord() Then
   record = id.DisplayElement.GetRecord()
   MessageBox.Show(record.Info, "5th Record Values")
End If

Screenshot

Record values displayed on button click

Figure 1: Record values displayed on button click

Samples:

C#: IdentifyGridStyleInfoRecord-C#

VB: IdentifyGridStyleInfoRecord-VB


Conclusion

I hope you enjoyed learning on how to identify a record in WinForms GridGroupingControl.

You can refer to our WinForms GridGroupingControl feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

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