I'm using mmMaintenanceForm, but I don't want the List, the mmDataGridView, to be editable. Just allowing column reordering and selection. The record selection to be made by the Enter key, or double-click.
Here's the code so far:
private void grdJobs_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
this.TabControl.SelectedTab = this.PropertiesPage;
}
}
private void grdJobs_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.TabControl.SelectedTab = this.PropertiesPage;
}
The problem is, the Enter key gets processed by mmDataGridView, and advances to the next record first. It looks like I have to subclass mmDataGridView, and override ProcessCmdKey to ignore the Enter or do the selection code there.
I've also had to set the mmDataGridView EditMode property to EditProgrammatically, otherwise any read only settings seem to get ignored, and a careful mouse click allows you to activate a cell for editing.
Also, MultiSelect = false, FullRowSelect = true.
Anyone else successfuly done something like this?
Is there an easier way of doing this?
Should I push for a new property in mmDataGridView that allows this before I do the subclassing and redo all my forms?
Thanks!