Home Forums WinForms controls Xceed Grid for WinForms AddHandler in Grid

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #14419 |

    I did click events in Unbound Grid Contorl and it works. But the same code is not working for Bound Grid.

    grdTest.DataSource = deliveryDS.Tables(0)

    grdTest.BeginInit()
    Dim cell As DataCell
    For Each cell In grdTest.DataRowTemplate.Cells
    AddHandler cell.Click, AddressOf ShowMsgBox
    Next

    Is there anything I should do with my code?

    Imported from legacy forums. Posted by PETE (had 1884 views)

    User (Old forums)
    Member
    Post count: 23064

    Better than add handler is to inherit your own grid, then datarow and then cell. It has a better performance and you don’t have to worry about adding and removing handlers, and it gives you greater power over everything.

    The other thing you could do is use the GetVisualGridElementAtPoint to the Grids MouseDown, Up or whatever event and then checking to see if it’s a cell, if it’s a cell then you have all the information you need.

    Imported from legacy forums. Posted by Chris (had 3042 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.