This question is locked. New answers and comments are not allowed.
Hi,
we've implemented a styleSelector for style switching. but cell backgroupd color and border could not be set
Style:
StyleSelector:
Another StyleSetter from telerik. but this style is only having border and background color, the text in girdcellview disappear.
And I've found a thread to set the Template , but it's complex, What we need is only to set the border color and cell background color,
Any suggestions? thank you in advance.
we've implemented a styleSelector for style switching. but cell backgroupd color and border could not be set
Style:
<Style x:Key="CellLv1Validation" TargetType="telerik:GridViewCell"> <Setter Property="BorderBrush" Value="Red"/> <Setter Property="BorderThickness" Value="1" /> <Setter Property="Background" Value="Yellow"/> </Style>StyleSelector:
public override Style SelectStyle(object item, DependencyObject container) { Style style = null; Uri uri = new Uri("/Solution.Common;component/Assets/ApplicationStyles.xaml", UriKind.RelativeOrAbsolute); ResourceDictionary converterDictionary = new ResourceDictionary() { Source = uri }; style = converterDictionary["CellLv1Validation"] as Style; DataRow dr = item as DataRow ; return dr.isNeedStyle ? style : null}Another StyleSetter from telerik. but this style is only having border and background color, the text in girdcellview disappear.
<Style x:Key="CellLv1Validation2" TargetType="telerik:GridViewCell" > <Setter Property="Background" Value="Red"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="telerik:GridViewCell"> <Border x:Name="PART_CellBorder" BorderBrush="Red" BorderThickness="1" Background="Yellow"/> </ControlTemplate> </Setter.Value> </Setter> </Style>And I've found a thread to set the Template , but it's complex, What we need is only to set the border color and cell background color,
Any suggestions? thank you in advance.