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
165
Get field properties in CellValuePresenter
posted

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

So how do I lift the field's label or other property into the CellValuePresenter?

Parents
No Data
Reply
  • 165
    posted

    This worked:

     

    <Label Grid.Column="0" Content="{Binding Field.Label, RelativeSource={RelativeSource TemplatedParent}}"  />

Children
No Data