Home Forums WinForms controls Xceed Grid for WinForms click event in grid

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

    How can I get the value in a given cell by clicking on the row?

    I want to use this in both bound and unbound grid.

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

    User (Old forums)
    Member
    Post count: 23064

    Catch the <b>CurrentRowChanged</b>-event of your grid.
    In the eventhandler, get the CurrentRow of the grid, try to cast it to a CellRow, and check to Cells-property:

    Xceed.Grid.CellRow row = grid.CurrentRow as Xceed.Grid.CellRow;
    if (row != null)
    {
    value = row.Cells[“myCell”].Value;
    }

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

    User (Old forums)
    Member
    Post count: 23064

    Thank you Tommy.
    I managed to convert your code to vb.net as follows and got the results.

    Dim row As Xceed.Grid.CellRow = grdCate.CurrentRow
    If Not Row Is Nothing Then
    MsgBox(row.Cells(1).Value)
    End If

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

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