1
Answer

Assign Value to ListPicker Windows Phone in C#

Aditya Patil

Aditya Patil

10y
1.1k
1
Date, Time & Text issue solved by below c# code
 dpkDate.Value = DateTime.Parse(note.Date);
 tpkDate.Value = DateTime.Parse(note.Time);
 TextField.Text = note.Text;

But Listpicker problem not solved yet.

ListBox Xaml Code

 <ListBox HorizontalAlignment="Left" Height="103" VerticalAlignment="Top" Width="456" Name="priority" Margin="10,302,-10,0" >
                <ListBoxItem x:Name="high" Content="High" Foreground="White" FontSize="24"/>
                <ListBoxItem x:Name="medium" Content="Medium" Foreground="White" FontSize="24"/>
                <ListBoxItem x:Name="low" Content="Low" Foreground="White" FontSize="24"/>
            </ListBox>

C# code written for ListPicker but its not working
priority.SelectedItem = note.Priority;
//((ListBoxItem)priority.SelectedItem).Content = note.Priority;

Screenshot of values while adding breakpoint you can see below.


At Query this value is passed perfectly

Value while allocating to Priority ListPicker, help me regarding it.
Problem only in Assigning the value to ListPicker.
Answers (1)