Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
Can anyone say how to merge 3/4/5/6 columns in a datagridview. in winforms
i need the following output
------------------------------------------------------------------
-------------- Name ------------- | -------- Subjects -------- |
------------------------------------------------------------------
First Name| Middle Name | Last Name | English | Science | Social |
------------------------------------------------------------------

In this 6 columns i am going to add data from Datatable
as a gridview sourcce





------------------------------------------------------------------
Posted

1 solution

Yeah...The DataGridView is not like the web control grid. I've never found a very elegant way to do this. What I did was basically create a label and put it over the top of the column headers of the columns I wanted to "merge". It requires either a re-sizing method or that you've set the column sizes to a constant size. And then formatting the grid and label to look nicer. If you find a better way, please let me know.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900