We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

applying a mask to an editable cell

Thread ID:

Created:

Updated:

Platform:

Replies:

49422 Sep 19,2006 02:34 AM UTC Sep 19,2006 04:34 AM UTC Windows Forms 1
loading
Tags: Grouping
Eric Weber
Asked On September 19, 2006 02:34 AM UTC

Hi....

I have an editable cell in a GGC. In QueryCellStyleInfo, I am trying to set a mask in order to limit the numeric value that a user can type into the cell. The numbers to be entered are share quantities. Positive whole numbers with no currency sign.

e.Style.ReadOnly = false;

e.Style.CellType = "Currency";
e.Style.CurrencyEdit.CurrencyDecimalDigits = 0;
e.Style.CurrencyEdit.CurrencySymbol = "";
GridMaskEditInfo mask = new GridMaskEditInfo();
mask.UsageMode = MaskedUsageMode.Numeric;
mask.Mask = "#,##0";
mask.MinValue = 0;
mask.MaxValue = 99999;
e.Style.MaskEdit = mask;

The above code doesn''t see to have any affect. I can still type in negative numbers and numbers larger than 99999.

What am I doing wrong?

Thanks in advance!

Eric

Administrator [Syncfusion]
Replied On September 19, 2006 04:34 AM UTC

Hi Eric,

The GridStyleInfo.MaskEdit properly is only used with the MaskEdit cell type. So you can change the e.Style.CellType property to "MaskEdit" in the QueryCellStyleInfo event.

e.Style.ReadOnly = false;

e.Style.CellType = "MaskEdit" ;

GridMaskEditInfo mask = new GridMaskEditInfo();
mask.UsageMode = MaskedUsageMode.Numeric;
mask.Mask = "#,##0";
mask.MinValue = 0;
mask.MaxValue = 99999;

e.Style.MaskEdit = mask;

Let me know if something like this will not work for you.

Regards,
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;