From: Ralph on 15 Apr 2010 08:34
Instead of one of the existing column types I would like to have a user
control appear in a cell in a gridview.
What I have done is created a control
CCTest : Control, IDataGridViewEditingControl
inherits from Control, and implements IDataGridViewEditingControl
I then create a cell class
TestCell : DataGridViewCell
in here I override public override void InitializeEditingControl(int
to set the editing control for the cell.
these get used in a column I create and add to the datagridview.
The problem I have is that I want the editing control to be the control that
appears when the user first opens the form.
In my test cell class I overrode Paint to do this.
In here I create an instance of the custom control I want to appear.
Then I use.
where tst is the instance of the control I created.
This works. However I was just curious as to if anyone has a better way to
I'm not really a fan of the solution I came up with.
Thanks in advance