Howto erase mask in empty maskedit cell

Hi, I am using a MaskEdit-Cell in a GridControl with a mask for a GUID "{AAAAAAAA-AAAA-AAAA-AAAA-AAAAAAAAAA}". Can I only show the mask when the cell-value is not empty? When the user does not enter data I want to get an empty string, when the user enters a value I want to get an string with mask. How can I get this behaviour in a standalone MaskedEditBox? Regards, Christian

2 Replies

AD Administrator Syncfusion Team June 13, 2006 04:36 AM UTC

Hi Christian, The gridControl1.DrawCellDisplayText event can be handled and there the DisplayText can be set to empty string(“”) when the MaskEdit cell value is empty. Below is a code snippet. Please post any standalone tools’ quires in the Essential Tools forums to get the solution at the earliest. private void gridControl1_DrawCellDisplayText(object sender, GridDrawCellDisplayTextEventArgs e) { if(e.Style.HasMaskEdit && !e.Style.HasCellValue) e.DisplayText = ""; } Regards, Calvin.


CL Christian Lützenkirchen June 13, 2006 06:07 AM UTC

Hi Calvin, thank you for your reply. It works fine. Regards, Christian

Loader.
Up arrow icon