Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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
 
Share this answer
 
Comments
Navas Khanj 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
 
Share this answer
 
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)

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