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

change background color dynamically

1 Answer 97 Views
Menu
This is a migrated thread and some comments may be shown as answers.
chris
Top achievements
Rank 1
chris asked on 17 Oct 2011, 02:07 AM
hi

how can i set the menu item  background color dynamically

background

the menu will work as a notification control. a timer will be set every 5 seconds to call the web service. the result will be added to an observable  collection. while looping through the collection if a condition is met the background color should change.

whats been accomplished

the timer is working..
the observable collection binds to the menu

to do

change background color dynamically when enabled = false

I've referenced the following example

http://www.telerik.com/help/silverlight/radmenu-populating-with-data-binding-to-dynamic-data.html

thanks

chris


 




1 Answer, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 20 Oct 2011, 12:42 PM
Hi Chris,

Please, correct me if I am wrong, but from what you explained, I understand that you wish to apply a different background color to the menu item when the menu item is enabled or disbaled.

If that is the case, then the most simple solution would be for you to use an ItemContainerStyle for the RadMenu and edit its visual states. Simply adjust the disabled state to reflect the background you wish. No additional code needed.

If this is not part of your scenario, I belive you will most probably need a solution where you apply a boolean-to-brush converter. If so, please share more details on your case.


Regards,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Menu
Asked by
chris
Top achievements
Rank 1
Answers by
Dani
Telerik team
Share this question
or