Add Control object into DataGridViewTextBoxCell
I have a class that is deriveded from DataGridViewTextBoxCell
and I want to add an Form.Control
开发者_Go百科object (like TextBox, CheckBox ..) into that cell but there is no control object that I can add new one into it.
In other words I want to create a cell that contains multiple control object. Is there any way to do?
Thanks
Using normal Windows.Forms controls is not possible. See the documentation, where it says: you must define classes that derive from DataGridViewColumn and DataGridViewCell. Or define a class that derives from Control and implements the IDataGridViewEditingControl interface. Reason is that the control must be able to cooperate with the hosting grid in exchanging values, handling edit mode, style etc.
精彩评论