Ticket T1158597
Visible to All Users

Masks - How to bind mask expressions and types to controls

created 2 years ago (modified 2 years ago)

[DevExpress Support Team: CLONED FROM T954426: Input Masks in Editors - WinForms Cheat Sheet]

Can I confirm the following and also wonder whether there is a plan to bring any of it back?:

We can no longer bind mask expressions and types to controls

Comments (2)
Sasha (DevExpress Support) 2 years ago

    Hello Simon,

    I am afraid the issue and your usage scenario are not entirely clear. Would you please describe them in greater detail or share a small sample project that illustrates what you mean? This information will help us precisely address your inquiry.

    S S
    Simon 'Skip' Gardiner 2 years ago

      Scenario

      I have a customer form. Name / Country Code / Phone

      I have a table of countries. Code / Name / PhoneRegex / PhoneMaskType

      Say there is a country lookup edit that changes Customer.CountryCode using a countrybindingsource BindingSource where the Datasource to the country table.

      because the country bindingsource selected row changes, I used to be able to bind the mask expression to countrybindingsource.PhoneRegex and the MaskType to countrybindingsource.PhoneMaskType.

      Will this ever be possible again?

      Answers approved by DevExpress Support

      created 2 years ago

      Hi Simon,

      Thank you for the clarification. Our editor mask API was not designed to allow binding mask-related properties to a data source in such a way. I recommend you handle the editor's EditValueChanged event and update mask settings in code - this solution is functionally identical but is much more reliable.

      Please let me know if you have additional questions.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.