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. Image for the cookie policy date
close icon

Customize "Invalid Text" message in maskedit cell (within a datagrid)

Hi, I am using a grid control and I have set the style of one of its columns to "MaskEdit". Here''s the code : gcAjustements.ColStyles(COL_MOIS_IMPACT_NUM).CellType = "MaskEdit" gcAjustements.ColStyles(COL_MOIS_IMPACT_NUM).MaskEdit.ClipMode = ClipModes.IncludeLiterals gcAjustements.ColStyles(COL_MOIS_IMPACT_NUM).MaskEdit.DateSeparator = "/" gcAjustements.ColStyles(COL_MOIS_IMPACT_NUM).MaskEdit.PromptCharacter = "*" gcAjustements.ColStyles(COL_MOIS_IMPACT_NUM).MaskEdit.PassivePromptCharacter = "*" gcAjustements.ColStyles(COL_MOIS_IMPACT_NUM).MaskEdit.PaddingCharacter = "*" gcAjustements.ColStyles(COL_MOIS_IMPACT_NUM).MaskEdit.Mask = "##/####" gcAjustements.ColStyles(COL_MOIS_IMPACT_NUM).MaskEdit.AllowPrompt = False In fact, I want the user to type in a month and year, in the following format : MM/YYYY **/**** is first shown and the * are replaced by what the user types in. If I do not respect the mask (like if *1/20** is shown), I get the message "Invalid Text: *1/20**" (which is good). However, I would like to customize this message, because my whole application is in french and I would want this message to also be in french. Could you please tell me how to do so? Thank you very much....

2 Replies

AD Administrator Syncfusion Team September 10, 2004 03:07 PM UTC

Try handling the grid.ValidateFailed event. In your handler, you can the default message by checking grid.CurrentCell.ErrorMessage. You can also put your own text into grid.CurrentCell.ErrorMessage.


OM Olivier Mayo September 21, 2004 11:12 AM UTC

Thanks you ;)

Loader.
Up arrow icon