This question is locked. New answers and comments are not allowed.
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.
Editing the template brings a couple of styles, but the selected visual state isn't there.
4 Answers, 1 is accepted
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?
Where's the edit or delete button?
0
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:
Here is the XAML for the styles
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
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
Hello Pantelis,
No worries, I have closed this thread on your behalf.
Regards,
Lance
Telerik
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.