Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1284
Cursor position of an editable cell on single click
posted
Hi I am working on Ultrawingrid. I want to select the whole text in a cell after going to edit mode only when i set blnselectAll to True. If blnselectAll is set to false the cursor should go to where i clicked. If i single click on 3rd character the cursor should go next to the third character. But it is going to first character. When i click for the second time it is going to the character where i click. I want this behaviour in the first click itself. I have written the following code in AfterenterEditmode With ActiveCell If blnSelectAll then If .EditorResolved.SupportsSelectableText AndAlso .Text.Length > 0 AndAlso .IsInEditMode Then .SelStart = 0 .SelLength = .Text.Length End If else .SelLength = 0 End if End With How to change the cursor position of a cell in edit mode on single click? Thanks Ashok
Parents
  • 469350
    Offline posted

    Hi Ashok,

    I'm not clear on what the problem is. If you click on a cell in the grid and that cell goes into edit mode, then the cursor is automatically positioned at the point where you clicked. 

    Your code is explicitly selecting all of the text in the AfterEnterEditMode event. So all you have to do is NOT call that code. 

Reply Children