Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using mmDataGridView as a picklist (Enter to Select)
Message
From
07/07/2006 15:01:03
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Using mmDataGridView as a picklist (Enter to Select)
Miscellaneous
Thread ID:
01134553
Message ID:
01134553
Views:
65
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!
Next
Reply
Map
View

Click here to load this message in the networking platform