I want to create a CellValuePresenter that will show the label of the field next to its value.
my field:
<igDP:UnboundField Name="LabledAsk" Label="Ask-" BindingPath="Ask" >
<igDP:Field.Settings>
<igDP:FieldSettings CellValuePresenterStyle="{StaticResource LabedCell}" />
</igDP:Field.Settings>
</igDP:UnboundField>
The Labled Cell bit:
<Style x:Key="LabedCell" TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Label Content="{TemplateBinding Label}" Grid.Column="0"/>
<Label Content="{Binding Value, RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="1"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
But it says :
Error 59 Cannot find the static member 'LabelProperty' on the type 'CellValuePresenter'. C:\WBlair-Spread\TheKitchenSink\SpreadViewer\SpreadViewer.xaml
This worked:
<Label Grid.Column="0" Content="{Binding Field.Label, RelativeSource={RelativeSource TemplatedParent}}" />