Add columns and rows manually to DataGrid

May 7, 2010 at 5:19 PM

Hi, I am trying to add columns and rows manually to DataGrid using the following code.

I can see the columns headers can be set. However, the rows are created but with no value displayed. In addtion, how could I set the row header text? we need to have a different row header text for each row.

In the code, the "Results" are a list of "result" object which contains different property values.


                foreach (Result result in Results)
                    DataGridTextColumn column = new DataGridTextColumn();
                    column.Header = result.Date;

                values = (from c in value
                          select c.property1).ToList();