Question

I have a ListPicker (from Telerik's Rad Controls suite) in PopUp Mode (with around 200 elements) with its visibility set to Collapsed. I want to open when it when I press a button, instead of when I press the control itself.

Basically I'm asking if there's any way of programatically opening a UI element in Windows Phone (something like Control.Open() in the code behind).

The context for my question is the following:

  • as you know, the selected item of a list picker is displayed in the page containing the control.
  • users can click on this item to activate the control.
  • I want to display only one of the properties in the page containing the control (for example MyObject.Name instead of the entire MyObject), but I can't do this because the SelectedItem and ItemsSource need to be of the same type.
  • I'm thinking of styling a button to look identical to the ListPicker's selected item.
  • I need to open the ListPicker programatically when I click on the button, I'll bind the button's text to MyObject.Name

Alternatively, I could just do a data template for the way the list picker is displayed, but I'm not convinced it's possible.

Était-ce utile?

La solution

Found the answer. It seems Telerik's List Picker allows you to set both an ItemTemplate for displaying items in the actual page, and a PopupItemTemplate for displaying items when the list is expanded. Both are Data Templates, so you can use Binding for values.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top