Home Forums WinForms controls Xceed Grid for WinForms Handling double click event for a Xceed.Grid.DetailGrid Reply To: Handling double click event for a Xceed.Grid.DetailGrid

Xceed Support
Member
Post count: 5658

You need to subscribe on the “Click” or the “Double-Click” event on the cell itself. Here is a snippet of code that illustrate this procedure:

e.g.,
<code>
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

For Each cell As Cell In dataRowTemplate1.Cells
AddHandler cell.DoubleClick, AddressOf cell_DoubleClick
Next
For Each cell As Cell In dataRowTemplate2.Cells
AddHandler cell.DoubleClick, AddressOf cell_DoubleClick
Next

‘Fill the grid with the DataSet
‘My grid is filled a master and a detail grid.
End Sub

‘The “Double-Click” will have the same result for the master and the detail grid.
Private Sub cell_DoubleClick(ByVal sender As Object, ByVal e As EventArgs)
‘Changing the Back Color of the Cell to Orange
DirectCast(sender, Cell).BackColor = Color.Orange
End Sub
</code>

Imported from legacy forums. Posted by CharlesB (had 785 views)