[英]add another column header on top to C# datagridview winform
I have a bounded datagridview with a lot of columns (around 40) and I'm wondering if I can add another column header on top of the default headers made with the SQL query. 我有一个有很多列(约40个)的有界datagridview,我想知道是否可以在用SQL查询创建的默认标题的顶部添加另一个列标题。 So it would look like a multi-row column header with some spanned columns. 因此,它看起来像是带有一些跨栏的多行列标题。
I've seen some solutions by painting custom column headers but they involve creating all the columns. 我已经通过绘制自定义列标题看到了一些解决方案,但是它们涉及创建所有列。 What if I leave the default headers made with the SQL query and just add a spanned column on top of it, is that possible? 如果我保留使用SQL查询创建的默认标头,然后在其顶部添加跨栏,该怎么办?
DataGridView
has no support for spanned columns. DataGridView
不支持跨栏。 You will need to either look at third party, custom rendering, or a second control parked just above your grid. 您将需要查看第三方,自定义渲染或停在网格上方的第二个控件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.