I've got a DataGridView in a modal window with a list of options for my program. The grid has two collumns. The first one contains a checkbox for selecting that option, the seccond is the name/description of that option. The winform also contains OK and cancel buttons but that's beside the point. The code below does what I want it to. Because of the FullRowSelect property the checkbox is checked/unchecked in you click anywhere withint that row. It does however not show a blue background or a dotted line around the current row anymore. How would I be able to add this without loosing any of the current functionality?
EDIT: To elaborate; what I want is to once again enable the dotted line and/or blue background on the selected row/cells. It looks like the code I have currently somehow disables this...
Relevant current code:
public OptionsForm()
{
InitializeComponent();
OptionsRoot = Options.GetReadOnlyRoot(OptionsBannersNameValueList.GetNameValueList(Settings.Default.OptionsBanners));
optionsBannersDataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
optionsBannersDataGridView.MultiSelect = false;
optionsBannersDataGridView.RowPrePaint += new DataGridViewRowPrePaintEventHandler(optionsBannersDataGridView_RowPrePaint);
InitUI();
Closing += MyFormClosing;
BindingSourceTree = BindingSourceHelper.InitializeBindingSourceTree(components, rootBindingSource);
}
private void optionsBannersDataGridView_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
{
e.PaintParts &= ~DataGridViewPaintParts.Focus;
}