BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
I am trying to implement drag and drop from a wpf tree control into the current cursor position in Syncfusion EditControl. I am handling the Drop event with:
privatevoid textEditor_Drop(object sender,DragEventArgs e)
{
textEditor.InsertText(e.Data.GetData("Text").ToString(), textEditor.LineNumber, textEditor.CursorIndex);
MessageBox.Show(textEditor.Text,"Title");
}
The result is shown in this screenshot:
As you can see, the message box called immediately after the InsertText() only contains the first line of the pasted text (which uses "\ n" characters for new lines, but I tried "\r" too with the same issue).
Yet the edit control has rendered the dropped text correctly.
If I manually edit the text and then do a MessageBox.Show(textEditor.Text, "Title") the full, multi-line text shows.
Is this a bug or am I implementing the InsertText() call incorrectly / missing an additional call to resolve the issue?
Many thanks!
OP here. The issue actually has nothing to do with drag and drop. You get the same issue whenever you insert multiline text into the control.
I added a wpf button and an event handler, which has the same issue as described in my original post:
private void deleteme_Click(object sender, RoutedEventArgs e)
{
textEditor.InsertText("SELECT * <newline> from<newline>mytable<newline>", textEditor.LineNumber, textEditor.CursorIndex);
}
Please substitute forward-slash n for <newline> in the code - the web editor seems to fail to render a typed forward-slash n newline character!
Hi Peter,
We were able to reproduce the reported issue at our end. We will validate and
provide the complete details within two business days.
Hi Peter,
We have confirmed the “InsertText(String, Int32, Int32) only updates first line of String into EditControl.Text” as an issue. We will include the fix for the reported issue in our upcoming weekly NuGet release which is expected to roll out on January 10 2023. We appreciate your patience until then. We will let you know once it gets rolled out.
Hi Karthick,
That's fantastic, thank you!
All the best,
Pete
Hi Peter,
We are glad to announce that our weekly nuget release was rolled out and a fix for the reported issue was included in the NuGet.
v20.4.0.43
NuGet Link: https://www.nuget.org/
We thank you for
your support and appreciate your patience in waiting for this release. Please
get in touch with us if you would require any further assistance.
Thank you Karthick. Yes, I have just updated to the new release and am very happy to confirm that the fix is successful!