开发者

Winform Merging two columns

HI, I want to create a datagridview in a form with 4 columns basically which has only 2 column headers,开发者_如何转开发 ie i want to merge only the column headers of 2 columns.

Thanks in advance


pls, check if code from this SO question winform - merging datagridview headers and its answers would work for you


i assume you're binding to a sql-provided datatable, right? If so, why not combine the results in your datatable and bind that. Simpler, with less programming.

E.g.

SELECT col1 + ' ' + col2, col3 + ' ' + col4 FROM someTable ORDER BY col1 + ' ' + col2

Fancier version:

SELECT col1 + ' ' + col2 AS 'Fancy Column Name 1' , 
col3 + ' ' + col4 AS 'Fancy Column Name 2 
FROM someTable ORDER BY col1 + ' ' + col2
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜