the easier way is to re-orient the dataset and bind it to the grid which
gives the same effect.
here's some code to flip 4 columns:
//flip the columns with the rows
double input = 0.0;
for(int col = 0; col < ds.Tables[0].Columns.Count; col++)
{
DataRow myRow = dsTemp.Tables[0].NewRow();
myRow[4]= 0.00;
if(Double.TryParse(ds2.Tables[0].Rows[0][col].ToString(),
System.Globalization.NumberStyles.Any,
System.Globalization.NumberFormatInfo.InvariantInfo, out input))
myRow[4]= input.ToString();
myRow[3]= 0.00;
if(Double.TryParse(ds.Tables[0].Rows[0][col].ToString(),
System.Globalization.NumberStyles.Any,
System.Globalization.NumberFormatInfo.InvariantInfo, out input))
myRow[3]= input.ToString();
if(Double.TryParse((Double.Parse(myRow[3].ToString()) -
Double.Parse(myRow[4].ToString())).ToString(),
System.Globalization.NumberStyles.Any,
System.Globalization.NumberFormatInfo.InvariantInfo, out input))
myRow[2]= input.ToString();
if(ds2.Tables[0].Rows[0][col].ToString().Trim() != String.Empty)
myRow[1]= Math.Round(((Double.Parse(myRow[2].ToString()) /
Double.Parse(ds2.Tables[0].Rows[0][col].ToString())) * 100),2);
myRow[0]= ds.Tables[0].Columns[col].ColumnName;
dsTemp.Tables[0].Rows.Add(myRow);
}