Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using mmDataGridView as a picklist (Enter to Select)
Message
De
07/07/2006 15:01:03
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Using mmDataGridView as a picklist (Enter to Select)
Divers
Thread ID:
01134553
Message ID:
01134553
Vues:
66
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!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform