Tools Windows Vol 3 Preview – Editor Controls | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (173).NET Core  (29).NET MAUI  (203)Angular  (107)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (211)BoldSign  (13)DocIO  (24)Essential JS 2  (106)Essential Studio  (200)File Formats  (65)Flutter  (132)JavaScript  (219)Microsoft  (118)PDF  (81)Python  (1)React  (98)Streamlit  (1)Succinctly series  (131)Syncfusion  (897)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (50)Windows Forms  (61)WinUI  (68)WPF  (157)Xamarin  (161)XlsIO  (35)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (146)Chart  (127)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (618)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (39)Extensions  (22)File Manager  (6)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (501)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (42)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (381)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (17)Web  (582)What's new  (323)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)

Essential Tools Windows Vol 3 Cool Preview – Editor Controls

ENHANCED NumberTextBoxes

PlatformWindows Forms
ProductTools
ControlEditors Package >> Editor Controls>> NumberTextBoxes
Feature(s)Enhancing Editor Controls

 

We’ve revamped NumberTextBoxControls ( IntegerTextBox, DoubleTextBox, CurrencyTextBox and PercentageTextBox). In this revamping process we’ve redefined the controls behavior and ensured the functionality of all the APIs in the mentioned controls.

We’ve moved all the common features and behaviors in to a single base class which is NumberTextBoxBase and overridden the required behavior alone in the respective controls.

 

PROPERTIES DEPRECIATED

PROPERTY
ALTERNATIVES
COMMENTS
NullStateIsNullDepreciated as it had Getter and Setter and was confusing. See IsNull for more details.
UseNullStringAllowNullThis behavior is incorporated with AllowNull; previously both AllowNull and UseNullString existed. They were removed for better clarity
IsNullValueIsNullIsNullValue means the same as NullState and IsNull; it has been deprecated for better clarity.
MaxLengthMaxValue,

NumberDecimalDigits (This is not available for IntegerTextBox)

This makes validation complex with MaxValue as 1000 and MaxLength as 2.

The same behavior can be achieved with the alternatives suggested.

EnforceMinMaxDuringValidatingOnValidationFailed.KeepFocusNo need for EnforceMinMaxDuringValidating, as MinMaxValidation exists already.

We’ve tweaked the controls to keep the focus inside the control when validation fails, which was the original intention of EnforceMinMaxDuringValidating, if needed by using OnValidationFailed.

NEWLY ADDED APIs

PROPERTYDESCRIPTIONBEHAVIOR
IsNull (Read Only)Returns a Boolean specifying the NullState of the controlTrue when Control.Text equals String.Empty or NullString
AllowNullSpecifies whether the field can be null.Related to NullString. When the field is null, NullString will be set. If you want to empty the control when the entire content is deleted then set AllowNull to true and NullString to String.Empty.
NullStringSpecifies the string that will be set when the field is null.Allow null must be true to set this string. If false, then Zero or MinValue, whichever is higher, will be set.

Leave it blank if the field has to be empty

*OnValidationFailedSpecifies the action to be performed when validation fails on a control loosing focus.

 

SetNullString,

SeMinOrMax,

KeepFocus.

(Refer to the notes for more details.)

 

 

 

BEHAVIORAL CHANGES

PROPERTYDESCRIPTIONBEHAVIOR
*MinMaxValidation.OnKeyPressEach and every key press is validated to ensure the value meets the constraints.This is most useful when MinValue is a single digit.

(Refer to the notes for more details.)

*MinMaxValidation.OnLostFocusValidation happens only when the control loses focus.This allows the user to enter any value  that will be validated when the focus is lost.

You can make use of the OnValidationFailed property to gain control over what has to be done when validation fails.

(Refer to the notes for more details.)

MinValueSets the minimum value allowed for the control. It cannot be greater than MaxValue.An exception will be thrown; reset the MaxValue accordingly.
MaxValueSets the maximum value allowed in the control. It cannot be lesser than MinValue.An exception will be thrown; reset the MinValue accordingly.
NullStringString to be displayed when the control’s value is made null. Cannot be a numeric value that could break the MinValue or MaxValue constraints.Example: MinValue 10, MaxValue 100 and NullString as “111” will break the min-max values.

Note:
Below are some general use-case scenarios for a better understanding of the behavior changes of the NumberTextBox controls (IntegerTextBox, DoubleTextBox, CurrencyTextBox, and PercentageTextBox).

Scenarios for better understanding:

  • With MinMaxValidation.OnKeyPress and MinValue as 10 – Each and every key press will be validated to meet the constraints, so this will not allow you to enter values less than 10, even if you try to enter 11 you cannot input the value as every keystroke is validated. This behavior is useful when MinValue is a single digit; in such cases, go for inMaxValidation.OnLostFocus.
  • With MinMaxValidation.OnLostFocus – User input will be validated only when a control loses focus. Hence, end-users can input any value. OnValidationFailed will give you access to what action [SetNullString, SetMinorMax, KeepFocus] has to be done when validation for the input fails.
  • With OnValidationFailed.SetNullString and AllowNull as False – The control will keep its focus as AllowNull is False.

If you need any clarifications or find any difficulties in using the control, please feel free to contact Syncfusion Technical support through Direct-Trac or our public Community Forums.

Thanks.

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed