FlexGrid for WinForms

Set C1FlexGrid.Editor SelectionStart, SelectionLength on StartEdit

  •  ou81aswell said 1 year, 5 months ago:

    After a call to C1FlexGrid.StartEdit, I’d like to set the editor’s SelectionStart and SelectionLength so that the edit cursor is at the end of the existing text. Currently, if I call StartEdit, all of the text in the current editor is selected.

    How do I do this?

    Thanks.

  •  Ashish Jindal16p said 1 year, 5 months ago:

    Hello,

    You can handle the StartEdit event of the flexgrid and use SendKeys class to place the cursor at the end of existing text. Here is the code for same:

    C# code:

       private void c1FlexGrid1_StartEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
            {
                SendKeys.Send("{END}");
            }
    

    VB Code:

    Private Sub c1FlexGrid1_StartEdit(sender As Object, e As C1.Win.C1FlexGrid.RowColEventArgs)
    	SendKeys.Send("{END}")
    End Sub
    

    Regards
    Ashish

    Answer
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.