Hi Akshay,
Thank you for contacting Syncfusion Support.
Query 1: Whenever I click outside the editor window, it inserts a new line in the editor and moves the cursor position to the end of the line I want to insert certain text from another control to wherever the cursor was on the editor, not necessarily on the new line.
We suspect that you are using AppendText method to insert the text. It will append the specified text to the end of the existing content of the EditControl. Please refer the below link for more details about AppendText method.
We can achieve your requirement using InsertText method. We have prepared a sample for your reference. In this, we have used InsertText method and get the current position of the Cursor using current line and current column. Please refer the below code snippet.
Code snippet
|
this.editControl1.InsertMode = true;
this.editControl1.InsertText(this.editControl1.CurrentLine, this.editControl1.CurrentColumn, "Inserting Text");
// Toggle the insert mode.
this.editControl1.ToggleInsertMode(); |
Please refer the below link for more details about InsertText method.
Query 2: I looked at the api of EditControl, and I am able to trigger an event handler for CursorPositionChanged event. However, it doesn't tell me how/when that event was triggered. I don't see any other methods/properties which would disable this behaviour.
The CursorPositionChanged event will be triggered when the cursor position changed. Please refer the below link for the same.
And this event can be disabled by return it. Please find the code snippet for the same in the below.
Code snippet
|
this.editControl1.CursorPositionChanged += EditControl1_CursorPositionChanged;
private void EditControl1_CursorPositionChanged(object sender, EventArgs e)
{
return;
} |
We have prepared a sample for your reference and it can be downloaded from the below link.
Please check the above solution and let us know if it is helpful.
Regards,
Venkateshwaran V.R.