DataGridTextColumn header binding

Dec 20, 2009 at 3:38 PM

I want to dynamically update/set the DataGridTextColumn header based on variable array in my code behind.

In my code behind.

        private List<int> years;
        public List<int> Years
                return years;
                years = value;

in my xaml file I have a datagrid, where I want to set the header on a column
            <toolkit:DataGrid ItemsSource="{Binding Prices}">
                    <toolkit:DataGridTextColumn Binding="{Binding Gloves}">
                            <Label Content="{Binding Years[0]}"/>

It doesn't seem to work, the header is empty (nothing is shown)
 - If I change Content="{Binding Years[0]}" to Content="2010" then the header shows 2010


Any help is appreciated.

thx in advance