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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Issue with masked controls when user mouse clicks

Thread ID:





28751 May 10,2005 07:25 AM UTC May 10,2005 07:20 PM UTC WinForms 1
Tags: Tools
James Donnelly
Asked On May 10, 2005 07:25 AM UTC

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.

Administrator [Syncfusion]
Replied On 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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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.