LookupPropertyDefinition with data template

1 posts, 0 answers
  1. Craig
    Craig avatar
    112 posts
    Member since:
    Nov 2011

    Posted 23 Oct 2012 Link to this post

    Hi
    I have successfully displayed a single property using a LookupPropertyDefinition. The drop down is positioned to the value corresponding the the PropertyGrid value as expected and the other available values are visible when the dropdown arrow is pressed. Here's an example of the XAML:

    <telerik:LookupPropertyDefinition x:Name="ccLookupDef"
      DisplayName="Lookup Code" Binding="{Binding MyPropCode}"
      SelectedValuePath="Code" ItemsSource="{Binding Data.MyCodes,  Source={StaticResource proxy}}"
      DisplayMemberPath="Description">
    </telerik:LookupPropertyDefinition>

     
    I'd would like to apply a data template to the content of the dropdown so I can display formatted content from multiple lookup properties.
    I've tried using the EditorTemplate but it fixes the lookup data and no dropdown button is displayed.

    Here's the code:

    <telerik:LookupPropertyDefinition x:Name="ccLookupDef"
      DisplayName="Lookup Code"
      SelectedValuePath="Code" ItemsSource="{Binding Data.ChargeCodes,  Source={StaticResource proxy}}">
      <telerik:LookupPropertyDefinition.EditorTemplate>
        <DataTemplate>
          <Grid Margin="0 3">
            <Grid.ColumnDefinitions>
              <ColumnDefinition />
              <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition />
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Text="{Binding MyPropCode}" />
            <TextBlock Grid.Row="0" Grid.Column="1" Margin="26,0,0,0" Text="{Binding Description}" />
          </Grid>
        </DataTemplate>
      </telerik:LookupPropertyDefinition.EditorTemplate>
    </telerik:LookupPropertyDefinition>


    Is it possible to use a data template with LookupPropertyDefinition?
    What have I done wrong here?

    Regards 
    Craig
Back to Top