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

Cannot collapse radListPicker

1 Answer 72 Views
ListPicker
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rohan
Top achievements
Rank 1
Rohan asked on 19 Feb 2013, 05:31 AM
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...
 
                        </StackPanel>
                    </StackPanel>
                </Grid>

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"

1 Answer, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 21 Feb 2013, 12:13 PM
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.
Tags
ListPicker
Asked by
Rohan
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or