<style type="text/css"> .NegativeText { color : Red; } </style>
WebNumericEditor™ allows you to style negative numeric values by simply setting the control’s NegativeCssClass property. This will make negative values in the WebNumericEditor control apparent.
Place a ScriptManager component and a WebNumericEditor control on the WebForm.
Include the following code in your ASPX source to define the negative text CSS class;Once this CSS class is associated to the WebNumericEditor control, the text will change to the color red as soon as a negative value is typed into the control.
In HTML:
<style type="text/css"> .NegativeText { color : Red; } </style>
Set the NegativeCssClass property either using the Microsoft® Visual Studio® Property Window or by using the following code:
In Visual Basic:
WebNumericEditor1.NegativeCssClass = "NegativeText"
In C#:
WebNumericEditor1.NegativeCssClass = "NegativeText";
Save and run your application. Type a negative value in the editor and as soon as the control loses focus you will observe that the CSS class gets applied to the editor similar to the following image: