Click here to Skip to main content
14,241,248 members
Rate this:
Please Sign up or sign in to vote.
I'm trying to get a specific DataGrid from an XML file:

          | 01/01/2015 | 02/01/2015 | 03/01/2015
Value 1   |   0.00025  | 0.0000026  |    0.01
.         |..
.         |..
Value n   |..
Average   |..
Expanse   |..

My Xml document is:
<?xml version="1.0" encoding="utf-8"?>

For each "control", i want to have a column with his data.

I tried a lot of things, flip datagrid (with layout transform) but without success, there are some datas which not appear when repainting window, add columns manually, but i cannot add rows manually...

Do you have a solution please?

Thanks and Excuse my English

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Only a quick suggestion (I don't understand what you tried, or trying to tell - lost in translation?):

Read in your XML to a internal representation of your data.

e.g. something like this

class Control
    public DateTime Date { get; set; }
    public double[] Values { get; set; }
    public double Avarage { get; set; }
    public double Expanse { get; set; }

...add the instances to a list

List<control> listControls;</control>

...bind them to your datagrid

datagrid.ItemsSource = listControls;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100