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

MaskEdit delete

I am using the gridcontrol in my application. I have set the cell type of one of the cells to MaskEdit. I have not specified any mask for this cell. When i enter data (string) in the cell and delete the text using Delete key the value(that particular character) is not getting deleted. But when i use backspace it works fine. Kindly let me know how to solve this problem.

3 Replies

AD Administrator Syncfusion Team August 16, 2005 01:03 PM UTC

I think this is a defect in our code. Here is a work-around using the CurrentCellControlKeyMessage event that worked for me. private void gridControl1_CurrentCellControlKeyMessage(object sender, GridCurrentCellControlKeyMessageEventArgs e) { Keys keyCode = (Keys)((int)e.Msg.WParam) & Keys.KeyCode; if(e.Msg.Msg == 0x100) //WM_KEYDOWN { if(keyCode == Keys.Delete) { GridMaskedEditBox meb = e.Control as GridMaskedEditBox; if(meb != null) { meb.SelectionLength = Math.Max(1, meb.SelectionLength); meb.SelectedText = ""; e.Handled = true; e.Result = true; } } } }
            


AD Administrator Syncfusion Team August 17, 2005 05:28 AM UTC

Clay This logic works fine for the maskedit cells that do not have any mask. But it broke the logic for the maskedit cells for which mask is given. After adding this code, for mask edit cells with mask, the delete key works.But after delete if i am using backspace it doesnot work. Kindly let me know how to solve this problem


AD Administrator Syncfusion Team August 17, 2005 08:10 AM UTC

How do I see the problem you are having in this sample? http://www.syncfusion.com/Support/user/uploads/GC_Print_6ff01a68.zip

Loader.
Live Chat Icon For mobile
Up arrow icon