Articles in this section
Category / Section

How does the DataGroups property affect the WinForms MaskedEditBox control?

2 mins read

DataGroups

The DataGroups property of the MaskedEditBox defines a virtual grouping of the mask value. Each group is defined by a MaskedEditDataGroupInfo object (the DataGroups property is a collection of these objects).

The DataGroups property can be accessed through the designer. A data group is defined by the GroupLength. For example if the the Mask is ###.###.###.### and there are 4 groups specified with Group Lengths of 4, 4, 4, 3 respectively, thr groups will be defined as: Group1 ###. Group2 ###. Group3 ###. Group4 ### The DataAlignment property of the MaskedEditDataGroupInfo object specifies the type of alignment to be used for the group. The data alignment behavior will be as defined below: Left aligned: All the filled in Mask fields in the group will be grouped to the leftmost positions. Right aligned: All the filled in Mask fields in the group will be grouped to the rightmost positions. Center aligned: All the filled in Mask fields in the group will be grouped to the centermost positions. The group alignments will only be enforced after the control has lost focus. The MaskedEditDataGroupInfo.Value property can be used to get the value of a group without any parsing. For example, if the Mask is (###) - ### #### Extn #### 3 groups can be defined as follows: Group1 - (###) Group2 - ### #### Group3 Extn - #### The value of Group 1 will be the area code, Group 2 will be the phone number, and Group 3 will be the extension.

 

Reference link: https://help.syncfusion.com/windowsforms/maskedtextbox/mode-settings

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied