Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C Sharp only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
C Sharp
How to set row values as Datagrid Column Header?
How to set row values as Datagrid Column Header?
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
lucindaa
New Member
Join Date:
Dec 2009
Posts:
11
#1
How to set row values as Datagrid Column Header?
Dec 31 '09, 06:07 AM
How to set row values as Datagrid Column Header?
Please any help me
ThatThatGuy
Recognized Expert
Contributor
Join Date:
Jul 2009
Posts:
453
#2
Dec 31 '09, 06:49 AM
You probably might be filling the datagrid with a datasource ....
So Manuallly loop through the Datagrid datasource...
get the row values and like this
dataSet1.Tables[0].Rows.Cells[0]
something like that....
and construct a new datatable and add the values of a the row as the DataColumn name of he dataTable.... it should be pretty simple
Comment
Post
Cancel
lucindaa
New Member
Join Date:
Dec 2009
Posts:
11
#3
Dec 31 '09, 07:14 AM
Problem Solved
Thanks for your help
Comment
Post
Cancel
ThatThatGuy
Recognized Expert
Contributor
Join Date:
Jul 2009
Posts:
453
#4
Dec 31 '09, 09:37 AM
Construct a
DataTable
like this....
DataTable dt=new DataTable();
then do
dt.Columns.Add( 'Here add the value retrieved');
do this for the no of times you like and assign this
DataTable
as a DataSource to the DataGrid.....
like this....
DataGrid1.DataS ource=dt;
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment