Home Forums WinForms controls Xceed Grid for WinForms How to get Row Number in Cell DblClick event Reply To: How to get Row Number in Cell DblClick event

User (Old forums)
Member
Post count: 23064

In the event handle, you can do the following :

Xceed.Grid.DataRow row = (Xceed.Grid.DataRow)( ( Cell )sender).ParentRow;
int rowIndex = row.Index;

So you cast the sender to a cell, with which you get the ParentRow. Note that this will work only if you have subscribed to the DataRowTemplate cells, else an exception may be raised if the row that is clicked is not a DataRow.

Imported from legacy forums. Posted by André (had 3123 views)