Home Forums WinForms controls Xceed Grid for WinForms Double Click Event Reply To: Double Click Event

User (Old forums)
Post count: 23064

I don’t understand the problem. Perhaps VB.NET has problems with indexers, collections and foreach.
Here is the code in VB.NET (untested):

‘ row is the Xceed.Grid.CellRow you want to detect double-clicks from
Dim cell As Xceed.Grid.Cell
Dim i As Integer
For i = 0 To row.Cells.Count – 1
AddHandler row.Cells.Item(i).DoubleClick, AddressOf CellDoubleClick

Private Sub CellDoubleClick(ByVal sender As Object, ByVal e As EventArgs)
Dim cell As Xceed.Grid.Cell
Dim row As Xceed.Grid.CellRow
cell = CType(sender, Xceed.Grid.Cell)
row = CType(cell.ParentRow, Xceed.Grid.Row)
End Sub

Imported from legacy forums. Posted by Tommy (had 339 views)