Home Forums WinForms controls Xceed Grid for WinForms Select Rows using code

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

    Hi all,
    I have a situation where when the user selects an item from a combo box i need to find the row(s) in the grid and highlight the rows (select the rows).
    Sure somebody must have done this before…quite a common scenario..

    Cheers,

    Imported from legacy forums. Posted by Sharad (had 3446 views)

    User (Old forums)
    Member
    Post count: 23064

    grid.SelectedRows.Clear();
    foreach(DataRow row in grid.DataRows)
    if (<i>row meets condition</i>) grid.SelectedRows.Add(row);

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

    User (Old forums)
    Member
    Post count: 23064

    Don’t forget. You might need to set the Grid.CurrentRow, too.

    Grid.CurrentRow = row

    Imported from legacy forums. Posted by MBonafe (had 307 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks guys,
    That worked fine for me

    Cheers

    Imported from legacy forums. Posted by Sharad (had 4481 views)

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