ok, i've got your point and found a previous code that i wrote for inverting
rows and columns
DataTable dt = (DataTable) dataGrid1.DataSource;
DataTable dt_dest = new DataTable();
dt_dest.Columns.Add ( dt.Columns[0].ColumnName );
for ( int i=0; i < dt.Rows.Count; i++ )
{
dt_dest.Columns.Add ( dt.Rows[i][0].ToString() );
}
for ( int i=1; i < dt.Columns.Count; i++ )
{
DataRow dr = dt_dest.NewRow();
dr[0] = dt.Columns[i].ColumnName;
for ( int r=0; r < dt.Rows.Count; r++ )
{
dr[r+1] = dt.Rows[r][i];
}
dt_dest.Rows.Add ( dr );
}
DataList.DataSource = dt_dest;
Hope This Helps
Regards
Martin
"David Lozzi" <dlozzi(remove-this)@delphi-ts.com> wrote in message
news:eG**************@TK2MSFTNGP12.phx.gbl...
I don't think this is what we're looking for, or is it.... Lemme see if I
can clear this up a little. This is how a DataGrid displays a table's data
now:
ID UserName Password Security
1 David dave 10 Edit
2 John doe 10 Edit
3 Mary smith 5 Edit
Correct me if i'm wrong, but we are looking for the datagrid to do the
following:
ID 1 2 3
Username David John Mary
Password dave doe smith
Security 10 10 5
Edit Edit Edit
Actually, its like a Pivot table? Maybe have a stored procedure handle the
returning values as a pivot table? Would it still be editable?
THANKS!
--
David Lozzi
Web Applications/Network Specialist
Delphi Technology Solutions, Inc.
dlozzi(remove-this)@delphi-ts.com
"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:ON**************@TK2MSFTNGP09.phx.gbl...
It must do that. Take a look at the microsoft article :
http://msdn.microsoft.com/library/de...ctiontopic.asp
Regards
Martin
"IGotYourDotNet" <IG************@discussions.microsoft.com> wrote in
message news:3A**********************************@microsof t.com... i tried that and it still only displays as
cars doors Cylinders
chevy 4 6
ford 2 8
i found an article once on how to change the header of the grid from the top to the side but i can't find it again. If i could find that that would
work on what i need
"Martin Marinov" wrote:
You have to use DataList control instead of DataGrid control
DataList control has a property RepeatDirection that will show your
data in the way you want by setting it to Horizontal
Regards
Martin
"IGotYourDotNet" <IG************@discussions.microsoft.com> wrote in message news:10**********************************@microsof t.com...
> I'm pulling data out of an oracle db and populating a datagrid such
as this
>
> cars doors Cylinders
> chevy 4 6
> ford 2 8
>
> how can i make it such as
>
> cars chevy ford
> cylinder 6 8
> doors 4 2
>
> if i can do this in either a datagrid or another way that would work
> thx
>