Cannot collapse radListPicker

2 posts, 0 answers
  1. Rohan
    Rohan avatar
    3 posts
    Member since:
    Aug 2012

    Posted 18 Feb 2013 Link to this post

    I have two pages in my app:
    - a MainPage.xaml, where I take some input from the user and navigate to ChooseTime.xaml.
    - ChooseTime.xaml, where I display a ListPicker.

    In ChooseTime.xaml, I have a StackPanel whose visibility I set to Collapsed (in xaml, as well as override the OnNavigatedTo). I have the ListPicker's SelectionChanged event hooked up to change the StackPanel's visibility to Visible. Basically, i want the user to arrive on the page to see nothing but the ListPicker. Once the user taps on an item on the list, I want more options aka the StackPanel to be visible.

    This isn't happening, presumably because from here, "RadListPicker selects the first item when a new data source is set and this behavior is by design". Can someone please explain how I can fix this with a code sample? Here's my code:

            <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,0,12,0">
                <StackPanel x:Name="TimePicker" Margin="0, 0,0,17" Width="422">
                    <TextBlock x:Name="NoResults" Text="" Grid.Column="1" Margin="10, 0, 0, 0" TextWrapping="Wrap"  />
                    <Controls:RadListPicker x:Name="radListPicker" IsEnabled="False" Visibility="Collapsed" InlineModeThreshold="6" SelectionChanged="radListPicker_SelectionChanged" />
                            <StackPanel x:Name="CreateNotifications" Margin="0, 0,0,17" Width="422" Visibility="Collapsed">
    More options here...

    private void radListPicker_SelectionChanged(object sender, SelectionChangedEventArgs e)
        CreateNotifications.Visibility = System.Windows.Visibility.Visible;

    EDIT: Title of post should read "Cannot unsubscribe from RadListPicker SelectionChanged event"
  2. Kiril Stanoev
    Kiril Stanoev avatar
    1508 posts

    Posted 21 Feb 2013 Link to this post

    Hello Rohan,

    Thank you for contacting us. Could you please examine the attached project and let me know how it works for you. I'd be glad to assist you further. 

    Kind regards,
    Kiril Stanoev
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
Back to Top