2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
GroupCaptionSectionTo get the records of a particular GroupCaptionSection, you can handle the TableControlCellMouseDown event and loop through the records in that group. To run the sample, right-click any GroupCaptionCell of a group to retrieve the records that belong to that group. C# //Hooks the TableControlCellMouseDown event in Form_Load this.gridGroupingControl1.TableControlCellMouseDown += gridGroupingControl1_TableControlCellMouseDown; void gridGroupingControl1_TableControlCellMouseDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellMouseEventArgs e) { if(e.Inner.MouseEventArgs.Button == MouseButtons.Right) { //Gets the style for the clicked cell GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex); Element el = style.TableCellIdentity.DisplayElement; GridCaptionRow gridCaptionRow = style.TableCellIdentity.DisplayElement as GridCaptionRow; if(gridCaptionRow != null) { string s = ""; foreach (Record rec in gridCaptionRow.GetCaptionSection().ParentGroup.Records) { //Retrieves the Values from the Record s += rec.GetValue("Name").ToString() + " " + rec.GetValue("WorkingBranch").ToString() + " " + Environment.NewLine; } //Shows the Content in the MessageBox MessageBox.Show(s); } } } VB 'Hooks the TableControlCellMouseDown event in Form_Load Me.gridGroupingControl1.TableControlCellMouseDown += gridGroupingControl1_TableControlCellMouseDown Private Sub gridGroupingControl1_TableControlCellMouseDown(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellMouseEventArgs) If e.Inner.MouseEventArgs.Button = MouseButtons.Right Then 'Gets the style for the clicked cell Dim style As GridTableCellStyleInfo = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex) Dim el As Element = style.TableCellIdentity.DisplayElement Dim gridCaptionRow As GridCaptionRow = TryCast(style.TableCellIdentity.DisplayElement, GridCaptionRow) If gridCaptionRow IsNot Nothing Then Dim s As String = "" For Each rec As Record In gridCaptionRow.GetCaptionSection().ParentGroup.Records 'Retrieves the Values from the Record s &= rec.GetValue("Name").ToString() & " " & rec.GetValue("WorkingBranch").ToString() & " " & Environment.NewLine Next rec 'Shows the Content in the MessageBox MessageBox.Show(s) End If End If End Sub The following screenshot displays the Group Caption Records. Samples: |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.