in
Forums
Blogs
DevExpress.com
Client Center
Support Center
DevExpress Channel

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
  • 12/6/2008 5:58 AM

    MaskEdit - how can I use EditMask?

     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
  • 12/8/2008 8:29 AM In reply to

    Re: MaskEdit - how can I use EditMask?

     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
  • 12/8/2008 12:20 PM In reply to

    Re: MaskEdit - how can I use EditMask?

    Try setting

    riTextEdit.Mask.UseMaskAsDisplayFormat = True;

  • 12/8/2008 1:25 PM In reply to

    Re: MaskEdit - how can I use EditMask?

    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
  • 12/8/2008 1:33 PM In reply to

    Re: MaskEdit - how can I use EditMask?

    Try setting riTextEdit.AllowNullInput to True.

  • 12/8/2008 1:49 PM In reply to

    Re: MaskEdit - how can I use EditMask?

    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
  • 12/8/2008 1:54 PM In reply to

    Re: MaskEdit - how can I use EditMask?

    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.

  • 12/8/2008 3:09 PM In reply to

    Re: MaskEdit - how can I use EditMask?

    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
  • 12/17/2008 5:46 AM In reply to

    Re: MaskEdit - how can I use EditMask?

     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
  • 12/17/2008 11:52 AM In reply to

    Re: MaskEdit - how can I use EditMask?

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

  • 12/17/2008 2:48 PM In reply to

    Re: MaskEdit - how can I use EditMask?

     OK. Thanks Brendon.

    Marcos Aguiar Jr
    Developer System
  • 12/22/2008 4:22 AM In reply to

    Re: MaskEdit - how can I use EditMask?

    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:
  • 12/22/2008 4:40 AM In reply to

    Re: MaskEdit - how can I use EditMask?

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

Copyright © 1998-2010 Developer Express Inc.
ALL RIGHTS RESERVED