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

Issue with masked controls when user mouse clicks

Hi. I''m having what''s likely an easy issue to resolve, but I haven''t had time to dig into the object model yet to find the answer (too many other things). This issue is bothering my clients though... In the GridDataBoundGrid I have a text box that accepts input for the phone number, so there is a mask in place. My clients love using their mouse and habitually mouse click into the phone number field rather than tab into it. When they click on the text box, they usually do so somewhere in the middle, and the cursor is set where they pointed. In order to begin typing in the phone number, you have to back up with the keyboard or try and carefully click to the far left of the text box. I''m assuming there''s a method to force the cursor to be at the initial position of the text box, but, as I mentioned, haven''t had time to dig into it and figure it out. Does anyone know this off the top of their head? Thx.

1 Reply

AD Administrator Syncfusion Team May 10, 2005 07:20 PM UTC

Hi James, You could set the ActivateCurrentCellBehavior to ''SetCurrent'' and can handle the CurrentCellControlGotFocus event and can explicity set the cursor position to see if that serves your purpose. this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.SetCurrent; this.gridControl1.CurrentCellControlGotFocus +=new ControlEventHandler(gridControl1_CurrentCellControlGotFocus); private void gridControl1_CurrentCellControlGotFocus(object sender, ControlEventArgs e) { if(e.Control is GridMaskedEditBox) { GridMaskedEditBox mt = (GridMaskedEditBox) e.Control; mt.SelectionStart = 1; } } Best regards, Jay N

Live Chat Icon For mobile
Up arrow icon