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[0].ToString() );
}
for ( int i=1; i < dt.Columns.Count; i++ )
{
DataRow dr = dt_dest.NewRow();
dr[0] = dt.Columns.ColumnName;
for ( int r=0; r < dt.Rows.Count; r++ )
{
dr[r+1] = dt.Rows[r];
}
dt_dest.Rows.Add ( dr );
}
DataList.DataSource = dt_dest;
Hope This Helps
Regards
Martin
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!