开发者

Add Control object into DataGridViewTextBoxCell

开发者 https://www.devze.com 2023-04-03 15:33 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消