This question is locked. New answers and comments are not allowed.
Hi,
I am trying to change the row style using a converter however if use the code below i get the wonderful error AG_E_RUNTIME_MANAGED_UNKNOWN_ERROR from microsoft. If i use a literal value like "Green" it then works.
I have also tried this on a cellstyle and have the same results.
The converter is very simple and returns a solid brush
I really wish silverlight had datatriggers. I have also attempted another way by using a cell style and add the textbox to the control template which works but i would prefere to adjust the rowstyle
I am trying to change the row style using a converter however if use the code below i get the wonderful error AG_E_RUNTIME_MANAGED_UNKNOWN_ERROR from microsoft. If i use a literal value like "Green" it then works.
| <telerik:RadGridView.RowStyle> |
| <StaticResource ResourceKey="GridViewRowStyleTest"/> |
| <Style TargetType="telerikGridView:GridViewRow"> |
| <Setter Property="Foreground" Value="{Binding Status,Converter={StaticResource workingvideoStatusForeground}}"/> |
| </Style> |
| </telerik:RadGridView.RowStyle> |
I have also tried this on a cellstyle and have the same results.
| <telerik:GridViewDataColumn Header="File" DataMemberPath="FileName" IsReadOnly="True"> |
| <telerik:GridViewColumn.CellStyle> |
| <Style TargetType="telerikGridView:GridViewCell"> |
| <Setter Property="Foreground" Value="Blue"/> <!-- "{Binding Status,Converter={StaticResource workingvideoStatusForeground}}"></TextBlock> --> |
| </Style> |
| </telerik:GridViewColumn.CellStyle> |
| </telerik:GridViewDataColumn> |
| public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
| { |
| SolidColorBrush brush = new SolidColorBrush(Colors.Black); |
| WorkingVideoStatusType wvStatusEnum = (WorkingVideoStatusType)System.Convert.ToInt32(value); |
| switch (wvStatusEnum) |
| { |
| case WorkingVideoStatusType.Complete: |
| { |
| brush = new SolidColorBrush(Colors.Green); |
| break; |
| } |
| case WorkingVideoStatusType.InProgress: |
| { |
| brush = new SolidColorBrush(Colors.Purple); |
| break; |
| } |
| case WorkingVideoStatusType.Waiting: |
| { |
| brush = new SolidColorBrush(Colors.Gray); |
| break; |
| } |
| case WorkingVideoStatusType.Failed: |
| { |
| brush = new SolidColorBrush(Colors.Red); |
| break; |
| } |
| } |
| return brush; |
| } |
I really wish silverlight had datatriggers. I have also attempted another way by using a cell style and add the textbox to the control template which works but i would prefere to adjust the rowstyle