Custom Property in Rad State Editor

2 posts, 0 answers
  1. Dan
    Dan avatar
    6 posts
    Member since:
    Jul 2008

    Posted 29 Aug 2008 Link to this post

      We would like to assign our own property to a rad UI control that we could then examine in the Rad State Editor.  For instance we could have a property added to the RadTextBox that could be called something like errorState.  We could then set errorState to true at either design time or run time to indicate the error state of the text box.  The controls default theme would then examine this property in a custom state created with the Rad State Editor in the Visual Style Builder. This would then dynamically apply the proper visual styles to the textbox for the custom error state.  This would allow us to encapsulate all visual elements of our application into a single master theme.
  2. Angel
    Admin
    Angel avatar
    121 posts

    Posted 01 Sep 2008 Link to this post

    Hi Dan,

    I attached a sample control library with a text box that has an ErrorState property. The text box (CustomTextBox) can be themed with Visual Style Builder - just use "Load Control" -> "From Assembly" menu and select the control library's assembly.

    In the sample, the default theme is in CustomTextBoxDefault.xml. In that theme, when ErrorState is IncorrectText the background color becomes red.

     
    Regards,
    Angel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top