I tried to look on the forum but didn't find a solution. How can I accomplish this?At the event there's e.X and e.Y of the cursor position, but I haven't found on the UltraTextEditor a way to get the Index at which the drop happen so I can setup SelectionStart and insert the necessary data.
If the UltraTextEditor is in edit mode, there will be a child TextBox control in it. So you could set AlwaysInEditMode to true and then use 'this.UltraTextEditor.Controls[0]' to get the TextBox control.
Once you have the TextBox, you can use the GetCharIndexFromPosition method.
https://docs.microsoft.com/en-us/dotnet/api/system.windows.controls.textbox.getcharacterindexfrompoint?view=netframework-4.7.2
The e.X and e.Y params in a drag event will be in screen coords, of course, so you will likely have to use PointToClient to convert the point first.
Ok, now that I figured out how to port the functionalities from UltraTextEditor to UltraFormattedTextEditor, I'm able to make it work.Thanks!
Hello Eugenio,
Thank you for contacting Infragistics!
You may want to consider using the UltraFormattedTextEditor as it has a method to get caret position form mouse location.