Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UserControls in DataGridView
Message
From
17/08/2007 13:41:13
 
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
UserControls in DataGridView
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01248831
Message ID:
01248831
Views:
67
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
Reply
Map
View

Click here to load this message in the networking platform