Why is it necessary to explicitely specify target type if I specify style inline like this?
<igDP:UnboundField BindingPath="." BindingMode="OneWay" Label="Changes" Converter="{StaticResource headerConverter}"> <igDP:UnboundField.Settings> <igDP:FieldSettings> <igDP:FieldSettings.CellValuePresenterStyle> <Style TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Control.FontWeight" Value="Bold"/> </Style> </igDP:FieldSettings.CellValuePresenterStyle> </igDP:FieldSettings> </igDP:UnboundField.Settings> </igDP:UnboundField>
I think this is because the CellValuePresenter is a derived class and its style needs to have a TargetType specified, which derives either from the targettype or the base type. This is the difference with the Button's style.
We will, however, take a closer look at this and investigate it.
Alex.
If this is a general wpf style thing, how come I can do just this on a regular button?
<Button Name="btnExport" Click="btnExport_Click" Content="Export"> <Button.Style> <Style> <Setter Property="Control.Background" Value="Pink"/> </Style> </Button.Style> </Button>
I believe this is not a question regarding XamDataGrid. This is related to WPF Framework and styles. No matter where style is declared -- in the resource section or like this, there should be a TargetType set. It all comes down to creating a new style.