Hi Ivan,
Regarding Question 1:
Please try this code
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if (this.gridDataBoundGrid1.Selections.Ranges.AnyRangeContains(GridRangeInfo.Row(e.RowIndex)))
{
e.Style.BackColor = selection_color;
e.Style.TextColor = SystemColors.HighlightText;
}
}
Regarding Question 2:
You can handle the Model.SelectionChanging event and set e.Cancel to TRUE to cancel the selection when the mouse move over the cell. Here is a code snippet
//Form Load event.
this.gridDataBoundGrid1.Model.SelectionChanging += new GridSelectionChangingEventHandler(Model_SelectionChanging);
void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
if (e.Reason == GridSelectionReason.MouseMove)
e.Cancel = true;
}
Here is a modified sample.
GDBGMultiSelectColor.zipBest Regards,
Haneef