Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 4:32am
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 at 26-Jan-13 11:09am
   
Wht I need table data want to show DGV header
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 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 CPallini 375
1 Sergey Alexandrovich Kryukov 370
2 BillWoodruff 314
3 George Jonsson 279
4 OriginalGriff 217
0 OriginalGriff 5,030
1 CPallini 4,115
2 Sergey Alexandrovich Kryukov 3,554
3 George Jonsson 2,826
4 Gihan Liyanage 2,386


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2014
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