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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get the current record when clicking the push button in cell selection mode in WinForms GridGroupingControl?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: September 26, 2018 |
Last Revised Date: December 23, 2019
Tags: selection

Selection mode

By default, the current record of the GridGroupingControl cannot be obtained when clicking the Push button in cell-based selection mode (using the AllowSelection property). The record can be obtained by using the TableControlPushButtonClick event and TableCellIdentity property.

C#

this.gridGroupingControl1.TableControlPushButtonClick += GridGroupingControl1_TableControlPushButtonClick; 
 
private void GridGroupingControl1_TableControlPushButtonClick(object sender,GridTableControlCellPushButtonClickEventArgs e) 
{ 
        GridTableCellStyleInfo style =this.gridGroupingControl1.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex); 
        Record record = style.TableCellIdentity.DisplayElement.GetRecord(); 
        if (record != null) 
        { 
            var value = record.GetValue("Name"); 
        } 
} 
 

 

VB

AddHandler Me.gridGroupingControl1.TableControlPushButtonClick, AddressOf GridGroupingControl1_TableControlPushButtonClick
 
Private Sub GridGroupingControl1_TableControlPushButtonClick(ByVal sender As Object, ByVal e As GridTableControlCellPushButtonClickEventArgs)
        Dim style As GridTableCellStyleInfo =Me.gridGroupingControl1.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex)
        Dim record As Record = style.TableCellIdentity.DisplayElement.GetRecord()
        If record IsNot Nothing Then
                 Dim value = record.GetValue("Name")
        End If
End Sub

 

Sample links:

C#: GridGroupingControl

VB: GridGroupingControl

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon 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.Close Icon

Live Chat Icon For mobile