ListPicker on TextBlock

5 posts, 1 answers
  1. Matt
    Matt avatar
    17 posts
    Member since:
    Jan 2013

    Posted 08 Jul 2013 Link to this post

    Would it be possible to implement a ListPicker style expander menu on a TextBlock? I have a form where I don't really want/need take up the space required to put a ListPicker control, and it's not a critical data-entry form anyways, so instead I would like the user to just click/tap on a TextBlock and have the expander pop-up for selection.

    Thanks!
  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 08 Jul 2013 Link to this post

    Hi Matt,

    You could go with a RadPickerBox instead of a RadListPicker. Here are some links to help you along:

    http://www.telerik.com/help/windows-phone/radpickerbox-visual-structure.html
    http://www.telerik.com/help/windows-phone/radpickerbox-features-content-and-popup-content.html

    If you want the expanding action of a RadListPicker instead of a popup, you can use the ListPicker without a Header and it will be approximately the same size as a TextBox.

    Good luck,
    Lancelot
  3. DevCraft banner
  4. Matt
    Matt avatar
    17 posts
    Member since:
    Jan 2013

    Posted 08 Jul 2013 Link to this post

    Thanks Lancelot.

    Not exactly what I was looking for though. I was thinking more like a TextBlock that can be tapped and then the popup can open. I don't want to 'bloat' the control with added space around the text. Something like this:
    <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding Name}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextNormalStyle}" x:Name="txtDefaultType" Tag="txtDefaultType_PopupOpen" />

    Then within the tap event handler is fired, the same type of popup window will open and let me select a new value.

    Thank you!
  5. Matt
    Matt avatar
    17 posts
    Member since:
    Jan 2013

    Posted 09 Jul 2013 Link to this post

    Perhaps I need to re-think my design. According to the design standards, "...Users don’t interact with TextBlock controls." and "A TextBlock control doesn’t include actionable controls."

    TextBlock control guidelines
  6. Answer
    Deyan
    Admin
    Deyan avatar
    2039 posts

    Posted 11 Jul 2013 Link to this post

    Hello Matt,

    Actually you can restyle the inline portion of the ListPicker/PickerBox control to look like a text block.

    Anyway, it is really not recommended to use TextBlock instances as user interaction elements as normally the users do not expect to be able to tap on text unless it is underlined or is the content of a button.

    I hope this helps.

    Regards,
    Deyan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
DevCraft banner