Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
695
border style for unbound fields in xamGrid
posted

I have a grid using Theme="Aero". by default i don't have grid lines for cells. For each of the <Field> i was able to create a style:

<Setter Property="BorderBrush" Value="#cccccc" />
<Setter Property="BorderThickness" Value="0,0,1,1" />

To give it a border.

I am trying to do the same thing for <UnboundField> but the grid line didn't show up. Why is that and what should I do to apply styles for <UnboundField>?

Thanks.

Parents
No Data
Reply
  • 695
    posted

    Update: the only difference between the two styles is  a "setter template" as following:

    <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="RowFieldStyle" >
                        <Setter Property="BorderBrush" Value="#cccccc" />
                        <Setter Property="BorderThickness" Value="0,0,1,1" />
    </Style>
                   
      <Style x:Key="ShowEjectCellStyle"
                           TargetType="{x:Type igDP:CellValuePresenter}" >
                        <Setter Property="BorderBrush" Value="#cccccc" />
                        <Setter Property="BorderThickness" Value="0,0,1,1" />
                        <Setter Property="Template">
                           
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                    <Button
                                      Content="Eject"
                                      HorizontalAlignment="Center"
                                      VerticalAlignment="Center"
                                      Click="EjectButton_Click"
                                        Margin="1,5,1,5"
                                        Padding="5"
                                      />
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
    </Style>

    So I think the template override the original cell style. What should i do so that the border brush can be propagated into template? Thanks.

Children