开发者

One data row that spans multiple DataGridView lines

In Winforms, is there a way to have a single DataGridView r开发者_Go百科ow span multiple lines? So that the cells of a single row can be stacked onto two lines.

Something like this:

One data row that spans multiple DataGridView lines


The only "simple" way to do this is with custom painting. It still isn't entirely trivial however, and you do not get editable cells this way.

Any solution to give editable cells would require a lot of custom code.

Quoting the DataGridView Program Manager Mark Rideout from a forum discussion:

The DataGridView does not have any support for merging cells. You can custom paint content across cells, but apart from that you would have to do a lot of work and custom coding to produce merged editable cells.

That forum does contain some example code of custom painting if that will do for your requirement.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜