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.
Hello,
You need to create template bindings inside the ControlTemplate for example:
<Button ... BorderBrush="{TemplateBinding BorderBrush}".../>
However, I believe only the Border element can respect the top,left, right, bottom independently values of the Thickness.
It would be best to wrap the Button into a Border and template bind these properties to the Border.
any idea from anybody?
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.