Click here to Skip to main content
11,496,146 members (1,078 online)
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
See more: VB.NET
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 5:32am
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 at 26-Jan-13 11:09am
   
Wht I need table data want to show DGV header
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 at 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 at 27-Jan-13 2:21am
   
update your question above clearly by using improve question Widget.
Navas Khanj at 27-Jan-13 3:17am
   
How to show
table data on DGV Header
Navas Khanj at 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 at 27-Jan-13 4:54am
   
I use DGV .columns.headertext=ds.rows(I).item(I)

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

  Print Answers RSS
0 Dnyaneshwar@Pune 692
1 RyanDev 230
2 CHill60 163
3 Sascha Lefèvre 145
4 Sergey Alexandrovich Kryukov 124
0 Sergey Alexandrovich Kryukov 10,401
1 OriginalGriff 8,910
2 Sascha Lefèvre 3,899
3 Maciej Los 3,422
4 Richard Deeming 2,600


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2015
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