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

Text selection in TextCell

I want to be able to select text in a textboxcell like in any other textbox (with control + shift + arrow keys). It seems that there is not behaviour like this in the 1.6.1.8 version. So I created my own one: in KeyDown of a cellrenderer derived from the GridOriginalTextBoxCellRenderer class I change SelectionStart and SelectionLength of the textbox. All works fine, but I cannot select text from the right to the left (Ctrl+Shift+Left) if starting at the end of the text, because the caret always go to the end of the selected text. I added a sample which shows the described behaviour. Is there any way around that? Peter SampleSelect_5625.zip

1 Reply

AD Administrator Syncfusion Team June 16, 2004 12:17 PM UTC

So, in your control things don''t work nicely becuase when you move to the left, the caret always ends up on the right side of the selection. I think you can move the cursor to the left side of a selection by doing a ''fake left click'' at that point. In this code snippet, replace activeRichTextBox with the active richtext control in your renderer code. p = Me.activeRichTextBox.GetPositionFromCharIndex(selectionStart) Syncfusion.Drawing.ActiveXSnapshot.FakeLeftMouseClick(Me.activeRichTextBox, p)

Loader.
Up arrow icon