Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XtraGrid whole row is highlighted except the clicked cell

When I select a row in the following GridView, the cell that my mouse is resting on (in other words the cell that I left click on) to select a row, is not highlighted while the rest of the row's cells are all highlighted.

I would appreciate your help.

GridView myView = (GridView)oGrid.MainView;
myView.OptionsSelection.MultiSelect = true;
myView.OptionsSelection.MultiSelectMode = GridMultiSelectMode.RowSelect;

if (myView.RowCount > 0)
{
    frmChangeMyStatus ff = new frmChangeMyStatus(ccfrms);
    DialogResult dr = ff.ShowDialog();

    if (dr == DialogResult.OK)
    {
        for (int i = 0; i < myView.SelectedRowsCount; i++)
        {
            row = myView.GetSelectedRows()[i];
               //...........
        }
    }
}
like image 705
user1298925 Avatar asked May 02 '12 19:05

user1298925


1 Answers

If you want the focused cell to look like any other cell in the focused row, disable focused cell styling in view properties. You can do this in two different ways:

  • At runtime:

    myView.OptionsSelection.EnableAppearanceFocusedCell = false;

  • At design-time: Invoke XtraGrid designer, select Views :: (your view) :: OptionsSelection :: Set EnableAppearanceFocusedCell to False.

If you have access to XtraGrid designer, you can check out the Appearance section if you need more complicated styling rules.

like image 188
Yuriy Guts Avatar answered Sep 27 '22 23:09

Yuriy Guts