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

controls to change background color when inital value changed

1 Answer 6 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 17 Apr 2014, 02:45 PM
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.

1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 21 Apr 2014, 09:15 AM
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? 

Regards,
Vanya Pavlova
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.

 
Tags
General Discussions
Asked by
Robert
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or