My problem is simple. I have an datagrid and a bound item colection to it.
The data shows with out any problem, but i want to format the cells.
The item in collection has simply said this structure:
{
public string Text { get; set; }
public string Title {get;set;}
public Brush BGBrush { get; set; }
public Brush Color { get; set; }
}
i mapped it like this:
<DataGridTextColumn Binding="{Binding Path=Text}" Header="{Binding Path=Title}" Foreground="{Binding Path=Color}" />
Data shows, but the foreground and background doesnt change.
Any help will be appreciated.
I may be doing it totally wrong, but i am just learning the datagrid.
Thanks a lot for help
You need to use
DataGridTemplateColumnfor your case as follows :Hope it helps