This question is locked. New answers and comments are not allowed.
Hello,
For my App, I needed a listbox like control, where the user would be able to search in. So I am using the pickerbox. When the user is navigating to that screen, initially the pickerbox shows a line of text (I removed the header and am using the button only) like : --- select ---. The actual popup is an usercontrol, as I needed a TextBox, a Button and a ListBox.
Initially when the user tabs the pickerbox button, the listbox in the usercontrol is filled with data from a WCF service. But when the user is not able to select the item he/she was looking for; the Texbox and button act as search tools.
So: the Page has the Pickerbox and the popup has the usercontrol:
The usercontrol:
The usercontrol has implement the selectionchanged method:
The page implements the UpdateListLocations method like:
Now everything works, but I need to update the pickerbox, as you see in the method above; lstLocations.Content = location.Name.
But right now the pickerbox does not update? Is there an way to do this?
For my App, I needed a listbox like control, where the user would be able to search in. So I am using the pickerbox. When the user is navigating to that screen, initially the pickerbox shows a line of text (I removed the header and am using the button only) like : --- select ---. The actual popup is an usercontrol, as I needed a TextBox, a Button and a ListBox.
Initially when the user tabs the pickerbox button, the listbox in the usercontrol is filled with data from a WCF service. But when the user is not able to select the item he/she was looking for; the Texbox and button act as search tools.
So: the Page has the Pickerbox and the popup has the usercontrol:
<
telerikPrimitives:RadPickerBox
x:Name
=
"lstLocations"
Content
=
"Select location"
Grid.Row
=
"2"
Padding
=
"0"
Margin
=
"0"
Height
=
"80"
IsFullScreen
=
"True"
Style
=
"{StaticResource RadPickerBoxStyle1}"
>
<
usercontrol:LocationsControl
/>
</
telerikPrimitives:RadPickerBox
>
The usercontrol:
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"#5B412A"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"80"
/>
<
RowDefinition
Height
=
"700"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
StackPanel
x:Name
=
"SearchPanel"
Grid.Row
=
"0"
Margin
=
"0"
Orientation
=
"Horizontal"
>
<
TextBox
Height
=
"72"
HorizontalAlignment
=
"Left"
Margin
=
"10,10,0,0"
Name
=
"txtSearch"
Text
=
""
VerticalAlignment
=
"Top"
Width
=
"380"
Grid.Row
=
"0"
/>
<
Button
Width
=
"100"
Height
=
"80"
Click
=
"btnSearchLocation_Click"
VerticalAlignment
=
"Top"
Grid.Row
=
"0"
BorderThickness
=
"0"
Margin
=
"-10,8,0,0"
Padding
=
"0"
Name
=
"btnSearchLocation"
>
<
Image
Width
=
"48"
Height
=
"48"
Name
=
"btnSearch"
HorizontalAlignment
=
"Left"
Source
=
"/WindowsPhone_App_010;component/Images/search.png"
Margin
=
"0"
/>
</
Button
>
</
StackPanel
>
<
ListBox
ItemTemplate
=
"{StaticResource LocationItemTemplate}"
Grid.RowSpan
=
"2"
Height
=
"700"
HorizontalAlignment
=
"Left"
Margin
=
"10,10,0,0"
Name
=
"lstLocations"
VerticalAlignment
=
"Top"
Width
=
"460"
Grid.Row
=
"1"
SelectionChanged
=
"lstLocations_SelectionChanged"
>
</
ListBox
>
<
telerikPrimitives:RadBusyIndicator
Background
=
"#CC000000"
x:Name
=
"busyIndicator"
IsRunning
=
"False"
Grid.Row
=
"1"
/>
</
Grid
>
The usercontrol has implement the selectionchanged method:
private void lstLocations_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Location selectedValue = (Location)e.AddedItems[0];
var frame = App.Current.RootVisual as PhoneApplicationFrame;
CreateArticle ca = frame.Content as CreateArticle;
ca.UpdateListLocations(selectedValue);
}
The page implements the UpdateListLocations method like:
public void UpdateListLocations(Location location) {
App.LocationViewModel.CurrentLocation = location;
lstLocations.Content = location.Name;
lstLocations.IsPopupOpen = false;
}
Now everything works, but I need to update the pickerbox, as you see in the method above; lstLocations.Content = location.Name.
But right now the pickerbox does not update? Is there an way to do this?