Forums

MaskEdit - how can I use EditMask?

Last post 12/22/2008 4:40 AM by Jérôme Ducobu. 12 replies.
Sort Posts: Previous Next
  • Marcos Aguiar Jr

    MaskEdit - how can I use EditMask?

    12/6/2008 5:58 AM
    • Not Ranked
    • Joined on 11/18/2008
    • Brazil
    • Posts 30

     Hi.

    I need that mask the grid is the brazilian default only number is Brazilian default and don't accepted negative value.
    For Example: one thousand is 1.000,00:
    I'm doing in runtime the following codec:

     

    RepositoryItemTextEdit ritTextEdit = new RepositoryItemTextEdit();

     

    ritTextEdit.MaskData.MaskType = MaskType.Numeric;

    ritTextEdit.MaskData.EditMask =

    "#0,00;";

    ritTextEdit.MaskData.SaveLiteral =

    true;

    bgc.ColumnEdit = ritTextEdit;

    Can somebody help me?

    Thanks.

    Marcos Aguiar Jr
    Developer System
  • Marcos Aguiar Jr

    Re: MaskEdit - how can I use EditMask?

    12/8/2008 8:29 AM
    • Not Ranked
    • Joined on 11/18/2008
    • Brazil
    • Posts 30

     Please, help me.

    Now, I'm doing in runtime the following codec:

    CultureInfo ciBrazil = new System.Globalization.CultureInfo("pt-BR"); 

    RepositoryItemTextEdit

    ritTextEdit = new RepositoryItemTextEdit();

    ritTextEdit.Mask.MaskType = MaskType.Numeric;

    ritTextEdit.Mask.EditMask =
    "N2";  

    BandedGridColumn.ColumnEdit = ritTextEdit;

     

    When I'm doing to change the cell values, mask is right, but when I finish to change and the cell values is mode display, mask is don't right.

    Please, Can somebody help me?

    System.Globalization.

    Marcos Aguiar Jr
    Developer System
  • Brendon Muck [DX Squad]

    Re: MaskEdit - how can I use EditMask?

    12/8/2008 12:20 PM
    • Top 10 Contributor
    • Joined on 5/16/2007
    • Buffalo, NY
    • Posts 5,815

    Try setting

    riTextEdit.Mask.UseMaskAsDisplayFormat = True;

    Please do not email me directly for support. Use the Support Center or Community Forums so that everyone may benefit.
  • Marcos Aguiar Jr

    Re: MaskEdit - how can I use EditMask?

    12/8/2008 1:25 PM
    • Not Ranked
    • Joined on 11/18/2008
    • Brazil
    • Posts 30

    Hi Brendon.

    Now the mask is correct, but I have cell which value is null and setting property UseMaskAsDisplayFormat is true the value 0 is show in cell that are NULL.

    How do I troubleshoot this problem?

     

    Marcos Aguiar Jr
    Developer System
  • Brendon Muck [DX Squad]

    Re: MaskEdit - how can I use EditMask?

    12/8/2008 1:33 PM
    • Top 10 Contributor
    • Joined on 5/16/2007
    • Buffalo, NY
    • Posts 5,815

    Try setting riTextEdit.AllowNullInput to True.

    Please do not email me directly for support. Use the Support Center or Community Forums so that everyone may benefit.
  • Marcos Aguiar Jr

    Re: MaskEdit - how can I use EditMask?

    12/8/2008 1:49 PM
    • Not Ranked
    • Joined on 11/18/2008
    • Brazil
    • Posts 30

    Sorry, don't work :(

    This is codec:

    RepositoryItemTextEdit ritTextEdit = new RepositoryItemTextEdit();

    ritTextEdit.Mask.MaskType = MaskType.Numeric;

    ritTextEdit.Mask.EditMask =
    "N2";

    ritTextEdit.Mask.Culture = ciBrazil;

    ritTextEdit.Mask.UseMaskAsDisplayFormat =

    true;

    ritTextEdit.AllowNullInput =

    DefaultBoolean.True;

    BandedGridColumn
    .ColumnEdit = ritTextEdit;

     

    The cell is completed with 0 when value is null and don't allows that delete the value.

    Some other idea?

    Thanks Brendon

     

     

     

    Marcos Aguiar Jr
    Developer System
  • Brendon Muck [DX Squad]

    Re: MaskEdit - how can I use EditMask?

    12/8/2008 1:54 PM
    • Top 10 Contributor
    • Joined on 5/16/2007
    • Buffalo, NY
    • Posts 5,815

    You may with to handle your Repositor Item's CustomDisplayText event to replace the 0 with a blank string in the event of a null value.

    Please do not email me directly for support. Use the Support Center or Community Forums so that everyone may benefit.
  • Marcos Aguiar Jr

    Re: MaskEdit - how can I use EditMask?

    12/8/2008 3:09 PM
    • Not Ranked
    • Joined on 11/18/2008
    • Brazil
    • Posts 30
    Answer

     Hi Brendon.

    I decided:

    RepositoryItemTextEdit ritTextEdit = new RepositoryItemTextEdit();

    ritTextEdit.Mask.MaskType =
    MaskType.RegEx;

    ritTextEdit.Mask.EditMask =

    "\\d+"

    ritTextEdit.AllowNullInput =

    DefaultBoolean.True;

    ritTextEdit.Mask.IgnoreMaskBlank =

    true;

     

     

     

    ritTextEdit.Mask.Culture = ciBrazil;

    ritTextEdit.Mask.UseMaskAsDisplayFormat = true;

     

    But I need that mask is 1.000 because is 1000.

    Thanks for help.

    Marcos Aguiar Jr
    Developer System
  • Marcos Aguiar Jr

    Re: MaskEdit - how can I use EditMask?

    12/17/2008 5:46 AM
    • Not Ranked
    • Joined on 11/18/2008
    • Brazil
    • Posts 30

     How do I a mask get 1.000?

    exemple:

    1000 need to stay 1.000

    1000000 need to stay 1.000.000

    Can Somebody help me?

    Thanks.

    Marcos Aguiar Jr
    Developer System
  • Brendon Muck [DX Squad]

    Re: MaskEdit - how can I use EditMask?

    12/17/2008 11:52 AM
    • Top 10 Contributor
    • Joined on 5/16/2007
    • Buffalo, NY
    • Posts 5,815

    It seems like no one here has an answer for you. You should probably contact DX support directly.

    Please do not email me directly for support. Use the Support Center or Community Forums so that everyone may benefit.
  • Marcos Aguiar Jr

    Re: MaskEdit - how can I use EditMask?

    12/17/2008 2:48 PM
    • Not Ranked
    • Joined on 11/18/2008
    • Brazil
    • Posts 30

     OK. Thanks Brendon.

    Marcos Aguiar Jr
    Developer System
  • Jérôme Ducobu

    Re: MaskEdit - how can I use EditMask?

    12/22/2008 4:22 AM
    • Not Ranked
    • Joined on 9/30/2008
    • Posts 11

    Hello, 

    I have also decided to work with a regex because i want to parse a value between 0 and 100 included formating 2 decimal (percent value). 

    I enter the regex 0.00|[0-9]{1,2}\R.[0-9]{2,2}|100.00.

    The data provide a Sql database.

    In Mask propoerty that works fine, but at starting software, the value is null, when i enter in the control, it display #0000.

    Is it an error with the regex ?

    Ethan

    Filed under:
  • Jérôme Ducobu

    Re: MaskEdit - how can I use EditMask?

    12/22/2008 4:40 AM
    • Not Ranked
    • Joined on 9/30/2008
    • Posts 11

     I answer myself at my post. The problem is due to the poperty value is a resx value.

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.