Click here to Skip to main content
13,507,984 members
Rate this:
Please Sign up or sign in to vote.
See more:
I want my datagridview header text my table fields.

My table
Class Feetype
I. Jan
I. Feb

I want DGV like this
Jan feb
Posted 26-Jan-13 4:32am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2


As my understanding you want to show row data on the row header.. You can check some articls on Pivot table in sql[^]

this might be helpful.

Navas Khanj 27-Jan-13 2:03am
Yes. Thanks. But I need one more help. DGV header want display table field. How can I get that suppose I add some filed use window form that also I want show DGV. please tell me how can I do for that.
Abhishek Pant 27-Jan-13 2:21am
update your question above clearly by using improve question Widget.
Navas Khanj 27-Jan-13 3:17am
How to show
table data on DGV Header
Navas Khanj 27-Jan-13 3:26am
select * from DailyIncome
pivot (max (IncomeAmount) for IncomeDay in ([MON],[TUE],[WED],[THU],[FRI],[SAT],[SUN])) as MaxIncomePerDay
where VendorId in ('SPIKE')
Above code mon tue... It's use manul code . But I want that my table data.
Navas Khanj 27-Jan-13 4:54am
I use DGV .columns.headertext=ds.rows(I).item(I)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

As per my understanding, when we set the datatable as a source for DGV, it will take the tables column name as a header row text.

Let me know if I misunderstood your question
Navas Khanj 26-Jan-13 11:09am
Wht I need table data want to show DGV header

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180417.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100