Hello,
We want to have a centralized method for displaying to a user that a field is required or has an error. Probably with either a background or border color change.
What strategies have you used with the Infragistics controls to implement this? Is there something built in that I am not seeing to manage this?
One thing you could do is create an Appearance in code and assign that same appearance to multiple controls. So say you wanted the back color of the reiquired fields to be red, you could do something like this:
private Appearance requiredAppearance = new Appearance();
requiredAppearance.BackColor = Color.Red;
this.ultraTextEditor1.Appearance = requiredAppearance;
this.ultraTextEditor3.Appearance = requiredAppearance;
this.ultraTextEditor5.Appearance = requiredAppearance;
Hello Mike,
We are using AppStylist to style our application. We aren't setting the style set or library directly on the control but for the application. Let's say we went ahead with the suggestion you gave and used an appearance. Once the user has fixed the problem causing a validation error, how would we reset the control back to the default appstylist style?
Regards,Fred Kuhne
Hi Fred,
You could do something like this:
this.ultraTextEditor1.ResetAppearance();
or:
this.ultraTextEditor1.Appearance = null;
If you want, you can even get your appearances from the application style library. The Appearance object has a property called StyleResourceName which allowsthe appearance to pick up it's settings from a resource defined in the style library.
Also, if you are using v8.2 of NetAdvantage, you might want to check out the new UltraValidator component, which can automatically apply appearances to controls and do validation for you.