Home Forums WPF controls Xceed DataGrid for WPF Highlight selected row

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

    Hi there,

    How can I force the DataGridControl to highlight (you know .. the blue bar) the selected row?
    My problem is that for example after a delete procedure the current row (which i set over .SelectedIndex = x) isnt highlighted (BUT it is “set”, .SelectedIndex and .SelectedItem does return the correct row). I also tried CollectionView.MoveCurrentTo(SelectedItem), but it also doesnt highlight the row.

    Thanks for help,
    best regards

    b.greber

    Imported from legacy forums. Posted by Benno (had 800 views)

    Xceed Support
    Member
    Post count: 5658

    What is the DataGridControl’s Theme you are using?

    Is it possible that the “InactiveSelectionBackground” is displayed (meaning that focus is not within the DataGridControl) ?

    Imported from legacy forums. Posted by Marcus [Xceed] (had 258 views)

    User (Old forums)
    Member
    Post count: 23064

    Yes thats possible, but setting the focus to the DataGridControl doesnt always have the desired effect)
    Is it possible to set the InactiveSelectionBackground to the same color as the highlight-color?

    Thanks, best regards

    Imported from legacy forums. Posted by Benno (had 401 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi,
    This solution works for me:

    private void SetSelectedIndex(Int32 index)
    {
    try
    {
    grid.SelectedIndex = index;
    }
    catch (Exception exc)
    {
    grid.CurrentItem = grid.Items[index];
    grid.Focus();
    }
    }

    Hope this help,
    Liviu

    Imported from legacy forums. Posted by winnetou (had 3837 views)

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