Click here to Skip to main content
13,200,202 members (54,927 online)
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
 
good
Please Sign up or sign in to vote.

Solution 2

Hi,


As my understanding you want to show row data on the row header.. You can check some articls on Pivot table in sql
http://blogs.msdn.com/b/spike/archive/2009/03/03/pivot-tables-in-sql-server-a-simple-sample.aspx[^]


this might be helpful.


RKS
  Permalink  
Comments
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
 
good
Please Sign up or sign in to vote.

Solution 1

Hi,
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
  Permalink  
Comments
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 |
Web03 | 2.8.171020.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2017
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