Popup displays class name

2 posts, 0 answers
  1. Karsten
    Karsten avatar
    6 posts
    Member since:
    Apr 2012

    Posted 28 Jun 2012 Link to this post

    After the recent update of the RadControls for Windows Phone 7 I am seeing some strange behavior with the ListPicker control.
    Instead of displaying the data values in the popup it is displaying the class name.

    To reproduce.
    Open the ExamplesCS_WP solution and goto ListPicker, Modes.xaml and change the InlineModeThreshold to 4 for both ListPickers.

    InlineModeThreshold="4" 

    The top listpicker works correctly and displays the colors in the popup, but the lower displays the classname.
  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 28 Jun 2012 Link to this post

    Hi Karsten,

    I have reproduced the strange behavior. I was able to fix the issue by adding a PopupItemTemplate along with the ItemTemplate. You can reproduce the fix using the same example and the popup template below. My explanation of why this happens is below.

    <telerikInput:RadListPicker.PopupItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="0, 27, 0, 24">
                                    <Rectangle Fill="{Binding ColorName}" Width="43" Height="43"/>
                                    <TextBlock Text="{Binding ColorName}" Margin="16 -8 0 0"/>
                                </StackPanel>
                            </DataTemplate>
                        </telerikInput:RadListPicker.PopupItemTemplate>


      The reason this happened is because you set the popup threshold lower than the amount of items. The control will then assume you want it to popup because there are more items than slots in the drop down. The reason you saw the class names is because you now have a control that is going to popup without an ItemsTemplate to hold the list.

    Once you add a PopupItemTemplate, you will be good to go.

    Good Luck,
    Lancelot
  3. DevCraft banner
Back to Top