controls to change background color when inital value changed

2 posts, 0 answers
  1. Robert
    Robert avatar
    57 posts
    Member since:
    Sep 2011

    Posted 17 Apr 2014 Link to this post

    Working with version 2014.1.224.45. mvvm pattern.

    I did this with janus systems winform controls awhile back and wanted to know if you had any best practices for my question/requirement.

    my client wants to provide visible feedback when the user changes values in the telerik controls (+ ms textbox).  For example, let's say a status dropdown is initially set to "active" and the user changes it to "on-hold".  my client wants the control to have a yellow background (versus current white) when the user changes it so that changes on the screen stand out.  Now once the user saves the data and the screen is refreshed, the yellow should go away because that is the "current" value and return to its initial color of white.

    Do you have any suggestions that could be used with telerik controls, e.g. styles or wrap/inherit from current controls, to accomplish this?

    I would imagine I could hook up all fields to a the view model to determine changes, but wasn't sure if I could handle this at the control level.

    thanks for any advice or input.
  2. Vanya Pavlova
    Vanya Pavlova avatar
    2019 posts

    Posted 21 Apr 2014 Link to this post

    Hello Robert,

    This could be a wide topic to discuss indeed. You have a variety of options to achieve this effect. 
    Once the value of this drop down is changed based on a property value of your view model, you may load a specific set of styles contained in a Resource Dictionary for the components that you are currently using.
    Let's say that you are currently using TextBox and you have two styles, isolated in different resource dictionaries, that change the Background of this element. Define a property of your ViewModel that will hold the current status value, check its value within the drop-down event handler and load the desired resource dictionaries. 

    Then the specific styles will be applied when a particular condition is met based on your requirements. 

    May you clarify how this corresponds to your needs? 

    Vanya Pavlova

    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.

Back to Top