This is a migrated thread and some comments may be shown as answers.

LookupPropertyDefinition with data template

0 Answers 89 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 23 Oct 2012, 01:33 PM
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

No answers yet. Maybe you can help?

Tags
PropertyGrid
Asked by
Craig
Top achievements
Rank 1
Share this question
or