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

Cursor Positioning on focus in a grid cell

Thread ID:

Created:

Updated:

Platform:

Replies:

47520 Aug 7,2006 03:25 PM UTC Apr 25,2007 04:30 PM UTC WinForms 2
loading
Tags: GridControl
Tom Affholter
Asked On August 7, 2006 03:25 PM UTC

I have a grid (grdPhone) comprized of three columns - phone number, type (Combobox) and comments. The phone number cell has a mask of (999) 999-9999.

Currently when a user clicks on the phone cell their position is set to the spot they click. How can I force the position to be 2, immediately following the first paren?

Thanks!

Tom

Administrator [Syncfusion]
Replied On August 8, 2006 08:05 PM UTC

Hi Tom,

You can handle the CurrentCellStartEditing event to place the cursor position as required in a cell by sending the Keys.

The following code snippet, handled the CurrentCellStartEditing event to move the cursor position to the second place in a cell by sending the Home and Right Keys.

// CurrentCellStartEditing event
SendKeys.Send("{HOME}");
SendKeys.Send("{RIGHT}");

Thanks,
Megavannan

Tom Affholter
Replied On April 25, 2007 04:30 PM UTC

Now that I am a bit more knowledgable in this matter I need to point out that you threw me far off track with your answer. In fact, if I have properly coded the mask, my cursor should have automatically positioned itself at the correct position after the first paren. My problem was that I have coded the format correctly, but I had failed to include the text property "(___) ___-____".

What I do not understand is why the Microsoft datetime picker allows 2 or 4 digit years and provides slashes while yours doesn't (sort of does with limitations). Using Syncfusion's advdatetimepicker for example, I can format only to one century. If I enter '97', I want 1997, not 2097. It should read +/- 50 years. Anything after 40 should return 1900 + the 2 digit year. Anything under 40 should return 2000. We are too close to the turn of the century. I might be mistaken, but I believe this is how the MS datetime works. Assuming logically you extended MS datetime picker, why would you override these features?

My solution was to scrap your control for Microsoft's. But I am giving up some nice features.

Thanks,

Tom

CONFIRMATION

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.

Warning Icon 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.Close Icon

;