How to display the values in a Grid from an arraylist

Hi, I'm having an arraylist and in the arraylist I have values for 24 hours in a day. For each Unit(which is a primary field) I have multiple column values for each hour. When I fill the datable and to dataset
and bind the dataset I get displayed vertically instead of horizontally how to flip the values and display it.

Here is how it looks like:

Hour Ending1
       Unit1,colum1,column2 values
Hour Ending 2
      Unit1,column1,column2 values
...SO on
Hour Ending 24
     Unit1,column1,column2 values.

Here is how I want:

Hour Ending1                                Hour Ending2    
Unit1,column1,column2 values        Unit1,column1,column2 values and
So on.. Hour Ending24.

comments:I'm currently doing this from the array list:

 ArrayList umarray = m_clsum.Build1(um); //<--I get arraylist from class.

                //System.Data.DataSet ds = new System.Data.DataSet("umarray");
                             DataSet ds = new DataSet();
                Type myType = umarray[0].GetType();
                System.Reflection.PropertyInfo[] api = myType.GetProperties();

                foreach (System.Reflection.PropertyInfo pi in api)
                System.Data.DataRow dr = null;
                foreach (object obj in umarray)
                    dr = dt.NewRow();
                    foreach (System.Data.DataColumn myColumn in dt.Columns)
                       dr[myColumn.Caption] = myType.GetProperty(myColumn.Caption).GetValue(obj, null);
                int i;
                int hour = DateTime.Now.Hour;
                for (i = 0; i <= (ds.Tables[0].Columns.Count - 1); i = i + 1)
                    ds.Tables[0].Columns[i].ColumnName = ds.Tables[0].Columns[i].ColumnName + hour;
                string colname;
                colname = ds.Tables[0].Columns[15].ColumnName;


Thanks VM
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Recreate the DataTable with the rows as columns.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.