Inserting InlineUIContainer as Cursor Location

2 posts, 0 answers
  1. Neil
    Neil avatar
    1 posts
    Member since:
    Sep 2012

    Posted 12 May 2015 Link to this post


    I am looking to insert an InlineUIContainer by drag/drop of something into the RichTextBox but following dropping of the element, unless it is simple text being inserted I am struggling to work out how to insert an InlineUIContainer at the current cursor location.

     I have managed to insert the control but only to the end of the document.

     A code snippet below might help but errors not at point of insert but when it is trying to update the screen next... The code is taken from the drop handler event.


                        Dim point = args.GetPosition(richTextBox)
                        Dim pos = richTextBox.ActiveEditorPresenter.GetDocumentPositionFromViewPoint(point)

                        Dim container As New InlineUIContainer()
                        container.UiElement = New CheckBox() With {.Content = "Testing"}
                        container.Height = 25
                        container.Width = 70

    Kind regards,




  2. Petya
    Petya avatar
    973 posts

    Posted 15 May 2015 Link to this post

    Hi Neil,

    Are you utilizing the DragDropManager from the WPF suite for this scenario?

    We actually have a very similar example in our SDK repository called Drag and drop in editor. It demonstrates insertion of text on drop, but the approach to insert an InlineUIContainer should be very similar.

    For your convenience I'm attaching a sample showing the exact scenario. I hope you'll find it useful.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top