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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridGgroupingControl and GridDataBoundGrid - get DataBound Object from Row

Thread ID:





121399 Dec 10,2015 06:52 AM UTC Jan 16,2018 08:34 AM UTC WinForms 6
Tags: GridDataBoundGrid(Classic)
Asked On December 10, 2015 06:52 AM UTC

I want to get DataBound object from row from GridGgroupingControl and GridDataBoundGrid when I make double click on grid.

For example, I have List<User> DataSource bound to grid. User is class which has UserName, Name, Surname and E-mail properties.
So in grid_double_click event I want to get:
1. object/s from selected Row/s, something like var userObject = grid.DataBoundItemFromRow... 
2. value from ID column, something like int ID = grid[row, "ID"] ...

How to achieve this with GridGgroupingControl and GridDataBoundGrid. Can you please make an example.

Thank You,


Solai A L [Syncfusion]
Replied On December 11, 2015 06:34 AM UTC

Hi Customer,

Thank you for using Syncfusion products.

To get record values in double click event of Grid Grouping Control
Please find the below code example and sample to get the doublecliked cell’s record.

Code Example :

this.gridGroupingControl1.TableControlCellDoubleClick += new GridTableControlCellClickEventHandler(gridGroupingControl1_TableControlCellDoubleClick);


void gridGroupingControl1_TableControlCellDoubleClick(object sender, GridTableControlCellClickEventArgs e)


            Record rec = this.gridGroupingControl1.Table.CurrentRecord;

            string column1value = rec.GetValue("Id").ToString();

            string column2value = rec.GetValue("A").ToString();

            string column3value = rec.GetValue("B").ToString();

            string column4value = rec.GetValue("Date").ToString();

            string column5value = rec.GetValue("Value").ToString();


Sample :


Note : We have used cell doubleclick event, you can use any other double click event to as per your need with the same code.

To get record values in double click event of grid data bound grid
Please find the below code example and sample to get the doublecliked cell’s record.

Code Example :

   this.gridDataBoundGrid1.CellDoubleClick += new GridCellClickEventHandler(gridDataBoundGrid1_CellDoubleClick);

   this.gridDataBoundGrid1.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(gridDataBoundGrid1_PrepareViewStyleInfo);          


void gridDataBoundGrid1_CellDoubleClick(object sender, GridCellClickEventArgs e)


            isdoubleclick = !isdoubleclick;


void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)


            if (isdoubleclick && e.RowIndex > 0 && e.ColIndex > 0)


                CurrencyManager cm = (CurrencyManager)BindingContext[gridDataBoundGrid1.DataSource, gridDataBoundGrid1.DataMember];

                DataRow row;

                DataView dv = (DataView)cm.List;

                //The 2 is the rowindex.

                int position = this.gridDataBoundGrid1.Binder.RowIndexToPosition(e.RowIndex);

                row = dv[position].Row;

                object[] SelectedRow = row.ItemArray;




Sample :


Note : We have used cell DoubleClick event, you can use any other double click event to as per your need with the same code.


Replied On December 11, 2015 08:26 AM UTC

Thank You for explanation but, I need something like this which you can do with  DataGrid:

object objectInGrid = dataGridView1.SelectedRows[0].DataBoundItem;

In this way I can get whole databound object from selected row. 
How I can do that with GridDataBoundGrid and GridGroupingControl?

Thank You, 


Replied On December 11, 2015 12:26 PM UTC

I figured it out.

Thank You.


Solai A L [Syncfusion]
Replied On December 14, 2015 05:07 AM UTC

Hi Customer,

Thank you for your update.

We are glad to know that your issue has been resolved. Please let us know if you have any concerns in future.


BRIEF Frederic
Replied On January 15, 2018 04:53 PM UTC

Another solution :   (DataBoundItem )

ClassObj myObj = this.gridGroupingControl1.Table.CurrentRecord.GetData() as ClassObj;

Piruthiviraj Malaimelraj [Syncfusion]
Replied On January 16, 2018 08:34 AM UTC

Hi Ferderic, 

Thanks for your update. 

Yes, you are right. The binding source object can be get by using CurrentRecord of Table. 



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.

Please sign in to access our forum

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

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