Hey all,
Im trying to give my rows specific colours. I want to do this by binding to a colour, but it's giving me some problems. Here's what I got right now.
And the converter:
Basically Im converting a colour to a solidcolorbrush, as you can see. However, when I try and run this code I get the following error:
AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 30 Position: 119]
--- Inner Exception ---
The given key was not present in the dictionary.
Does anyone know what's causing this? The bindings are all correct, they work fine if I use a datatemplate and a stackpanel. But the stackpanel doesn't look as nice as giving the background of the column a colour.
Thanks for taking the time to read about my problem, I hope someone has the solution.
Im trying to give my rows specific colours. I want to do this by binding to a colour, but it's giving me some problems. Here's what I got right now.
<telerikGrid:RadGridView x:Name="TasksGridView" |
ItemsSource="{Binding Tasks}" |
DataContext="{Binding}" |
AutoGenerateColumns="False" |
IsReadOnly="True" |
CanUserFreezeColumns="False" |
DataLoadMode="Asynchronous" |
> |
<telerikGrid:RadGridView.Columns> |
<telerikGrid:GridViewDataColumn DataMemberBinding="{Binding Subject}" Header="Subject" Background="{Binding Category.BackColor, Converter={StaticResource colorToSolidColorBrushConverter}}"/> |
</telerikGrid:RadGridView.Columns> |
</telerikGrid:RadGridView> |
And the converter:
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
{ |
var color = (Color) value; |
return new SolidColorBrush(color); |
} |
Basically Im converting a colour to a solidcolorbrush, as you can see. However, when I try and run this code I get the following error:
AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 30 Position: 119]
--- Inner Exception ---
The given key was not present in the dictionary.
Does anyone know what's causing this? The bindings are all correct, they work fine if I use a datatemplate and a stackpanel. But the stackpanel doesn't look as nice as giving the background of the column a colour.
Thanks for taking the time to read about my problem, I hope someone has the solution.