how do I host a control in a DataGridViewCell for displaying as well as editing?

后端 未结 3 987
清酒与你
清酒与你 2021-01-21 17:18

I\'ve seen How to: Host Controls in Windows Forms DataGridView Cells which explains how to host a control for editing a cell in a DataGridView. But how can I host a control for

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-21 17:48

    Rather than use a datagridview, how about using a TableLayoutPanel instead. Create your control that has a label and a button and events and fill your layout panel with them. Your control becomes the cell so to speak. It doesn't take much to make the table layout panel to look like a datagridview, if that is the layout style you want.

提交回复
热议问题