This is a migrated thread and some comments may be shown as answers.

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

4 Answers 23 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pantelis
Top achievements
Rank 1
Pantelis asked on 24 Jun 2014, 09:29 AM
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.

4 Answers, 1 is accepted

Sort by
0
Pantelis
Top achievements
Rank 1
answered on 24 Jun 2014, 10:34 AM
Found it, I was looking for the ItemContainerStyle.

Where's the edit or delete button?
0
Lance | Manager Technical Support
Telerik team
answered on 25 Jun 2014, 12:00 PM
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.

 
0
Pantelis
Top achievements
Rank 1
answered on 25 Jun 2014, 12:03 PM
Sorry for the confusion, I meant the edit/delete thread button here in the forums.
0
Lance | Manager Technical Support
Telerik team
answered on 25 Jun 2014, 12:13 PM
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.

 
Tags
DataBoundListBox
Asked by
Pantelis
Top achievements
Rank 1
Answers by
Pantelis
Top achievements
Rank 1
Lance | Manager Technical Support
Telerik team
Share this question
or