How to set a storyboard for the selected visual state on RadDataBoundListBox

5 posts, 0 answers
  1. Pantelis
    Pantelis avatar
    7 posts
    Member since:
    Jan 2012

    Posted 24 Jun 2014 Link to this post

    I'm having a little trouble modifying the selected visual state of an item in the control.
    Editing the template brings a couple of styles, but the selected visual state isn't there.

  2. Pantelis
    Pantelis avatar
    7 posts
    Member since:
    Jan 2012

    Posted 24 Jun 2014 in reply to Pantelis Link to this post

    Found it, I was looking for the ItemContainerStyle.

    Where's the edit or delete button?
  3. DevCraft banner
  4. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    135 posts

    Posted 25 Jun 2014 Link to this post

    Hi Pantelis,

    There is no built-in Edit or Delete button for a DataBoundListBox item. If you are referring to a ContextMenu that pops out when the user taps and holds an item (which frequently contains an "edit" and "delete" option), that is done by using the RadContextMenu.

    You can see how to add it to a list control here in the documentation, but it can be used on any arbitrary UIElement. You can indeed style the ContextMenu and ContextMenuItem, to help demonstrate this I have written an example project that shows how to use a custom ContextMenu within a DataBoundListBox.

    Download, run the app, then tap and hold an item in the list to show the custom-styled ContextMenu.

    Here is the ContextMenu within the DataBoundListBox referencing the custom styling:

    <telerikPrimitives:RadContextMenu.ContextMenu>
                    <telerikPrimitives:RadContextMenu x:Name="customContextMenu"
                                Style="{StaticResource CustomContextMenuStyle}"
                                ItemStyle="{StaticResource CustomContextMenuItemStyle}"
                                Opening="OnMenuOpening" />
    </telerikPrimitives:RadContextMenu.ContextMenu>


    Here is the XAML for the styles

    <Style x:Key="CustomContextMenuStyle" TargetType="telerikPrimitives:RadContextMenu">
           <Setter Property="Background" Value="{StaticResource PhoneAccentBrush}" />
    </Style>
    <Style x:Key="CustomContextMenuItemStyle" TargetType="telerikPrimitives:RadContextMenuItem">
           <Setter Property="Foreground" Value="White" />
           <Setter Property="FontSize" Value="16" />
           <Setter Property="FontWeight" Value="Bold" />
    </Style>


    If you are looking to do something different or you meant something else by "edit" and "delete" button, please provide more information about what you're trying to achieve.

    Thank you for contacting Support and thank you for choosing Telerik.

    Regards,
    Lance
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Pantelis
    Pantelis avatar
    7 posts
    Member since:
    Jan 2012

    Posted 25 Jun 2014 in reply to Lance | Tech Support Engineer, Sr. Link to this post

    Sorry for the confusion, I meant the edit/delete thread button here in the forums.
  6. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    135 posts

    Posted 25 Jun 2014 Link to this post

    Hello Pantelis,

    No worries, I have closed this thread on your behalf.

    Regards,
    Lance
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner