General information
Title:
UserControls in DataGridView
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only