Change a style element at runtime

2 posts, 0 answers
  1. Bryan Brannon
    Bryan Brannon avatar
    65 posts
    Member since:
    Aug 2012

    Posted 22 Jan 2007 Link to this post

    Is there a way to change or override a theme attribute or color at runtime?  I can make a new theme for the button/control and change the theme at runtime but would like to change like the background color at runtime.  Is this possible?
  2. Mike
    Mike avatar
    640 posts

    Posted 23 Jan 2007 Link to this post

    Hello Bryan,

    Actually there is a way to change or "overwrite" the style at runtime, though it is not currently very simple to do that.

    Attached is a sample application that demonstrates the stylesheet API, that is also used internally by RadControl to populate the Style of the controls, depending on the theme selected. As demonstrated, the actual task to change an element property is not very hard to achieve. The difficulty in the case presented in the example comes from the dynamic style behavior - the ribbon chunks' fill colors are animated when the IsMouseOver property changes.

    Kind regards,
    the telerik team
Back to Top