Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WinForms DataGrid delete
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00949754
Message ID:
00950323
Vues:
12
>Bind to a DataView and set the AllowDelete property of the dataview to false.

Thanks. I set AllowDelete like this:
((DataView)((CurrencyManager)this.BindingContext[this.dsVendors,"Vendor"]).List).AllowDelete = false;
There seems to be one slight drawback to this approach, if you use it on an mmBusinessForm. If you run the form and select rows in the grid and press the Delete key, nothing is deleted (due to DataView.AllowDelete=false), which is great. However, MM.NET is tricked into thinking that a data edit did take place, because when you close the form (if you use a button with DialogResult=OK), MM.NET prompts "Do you want to save changes?"

Probably best to just use a plain old System.Windows.Forms.DataGrid in this situation (read-only datagrid). Not much benefit in using an mmDataGrid if you're not updating data, I suppose.

Thanks again.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform