Change Telerik GridViewCellColor based on value

You can change Gridview cell color based on a value by using CellStyleSelector in GridViewDataColumn.
First you have to add a class by inheriting StyleSelector and override SelectStyle method
public class MyStyle:StyleSelector
{
public override Style SelectStyle(object item, DependencyObject container)
{
if(item is Student)
{
var objEntity = item as Student;
if (objEntity.Mark > 60)
{
return Green;
}

}
return null;
}
public Style Green { get; set; }
}
Add a Grid Resource

<Grid>
<Grid.Resources>
<my:MyStyle x:Key="myStyle">
<my:MyStyle.Yellow>
<Style TargetType="telerik:GridViewCell">
<Setter Property="Background" Value="Green" />

</Style>
</my:MyStyle.Yellow>
</my:MyStyle>
</Grid.Resources>

</Grid>

Apply the style to GridViewDataColumn CellStyleSelector Attribute

<telerik:GridViewDataColumn DataMemberBinding="{Binding Mark}" CellStyleSelector="{StaticResource myStyle}">
</telerik:GridViewDataColumn>

Happy coding…

This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms

1

 

I have seen this error two times before when i try to build WPF and WindowsPhone application .I had a hard time with this issue.

How to resolve this error?

Open the Run window and type regedit 

2

Click OK and then Navigate to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa 

3

4

 

DELETE this registry entry by right clicking the FipsAlgorithmPolicy folder and restart the application.It will resolve the issue