Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UserControls in DataGridView
Message
De
17/08/2007 13:41:13
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
UserControls in DataGridView
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01248831
Message ID:
01248831
Vues:
68
Hi,

Anyone had experience siting UserControls in a DataGridView. I've a DataGridViewCell using a UserControl implementing IDataGridViewEditingControl as the EditType.

Is there an AutoSizing mode of the DataGridView which will automatically expand the Row/Column sizes when the UserControl is activated?

I couldn't find one so tried setting the increased sizes in the PrepareEditingControlForEdit() method and resetting to the default size in the DataGridView.RowLeave event. This works OK until the value returned by the UserControl is changed. When this happens the RowLeave fires and resets the Row height but, for some reason, the PrepareEditingControlForEdit() method is called again by the DataGridView (causing the size to be reset to the larger version).

Anyone know why this happens? Or a workaround? Or an alternate approach altogether?

TIA,
Viv
Répondre
Fil
Voir

Click here to load this message in the networking platform