Set the Border and the background in a cell style selector

2 posts, 0 answers
  1. Mark
    Mark avatar
    50 posts
    Member since:
    Dec 2010

    Posted 02 Sep 2015 Link to this post

    In a follow up from this thread I need to set both the border and the background of the cell using a cellstyleselector. This is the style so far...

    <Style  x:Key="IsEventStyle"
        <Setter Property="Template">
                <ControlTemplate TargetType="telerik:GridViewCell">                
                    <Border BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}">
                        <ContentPresenter Content="{TemplateBinding Content}"
                                                            ContentTemplate="{TemplateBinding ContentTemplate}" />
        <Setter Property="BorderThickness"
        <Setter Property="Margin"
                        Value="0,1,0,1" />
        <Setter Property="BorderBrush"
        <Setter Property="VerticalAlignment"
                        Value="Stretch" />
        <Setter Property="HorizontalAlignment"
                        Value="Stretch" />
        <Setter Property="Background"
                        Value="PapayaWhip" />

    The last setter (background) has no effect.. 

    Any help will be appreciated. 



  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 03 Sep 2015 Link to this post

    Hello Mark,

    You should define the Background to the redefined Border directly:
    <Border BorderBrush="{TemplateBinding BorderBrush}"
        BorderThickness="{TemplateBinding BorderThickness}" Background="PapayaWhip">

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top