views:

96

answers:

2

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

A: 

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

serge_gubenko
A: 

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
Paul Sasik