简体   繁体   中英

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. 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?

DataGridView has no support for spanned columns. You will need to either look at third party, custom rendering, or a second control parked just above your grid.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM