Home › Forums › WinForms controls › Xceed Grid for WinForms › Right click and get row values
How can I get the row details by right clicking?
Imported from legacy forums. Posted by PETE (had 1964 views)
Because the row (CellRows) contain cells, it is the cells that will capture the events and not the cellrow. Therefore, you will need to subscribe to the events of each cell in the row if you want to know when the user clicks on a row. For example:
GridControl1.DataSource = DataSet11GridControl1.DataMember = “Orders”
Dim cell As DataCell
For Each cell In GridControl1.DataRowTemplate.Cells AddHandler cell.Click, AddressOf Me.cell_ClickNext cell
In the Click event handler, you can then check the cell’s <a href=”http://doc.xceedsoft.com/products/gridNet/ref/xceed.grid.cell.parentrow.html”>ParentRow</a> property to access the row. For example:
Dim cell As Cell = CType( sender, Cell )Dim parentRow As CellRow = cell.ParentRow
I hope this helps!
Imported from legacy forums. Posted by Jenny [Xceed] (had 3119 views)