Drag Drop Text from RadListBox as complete Object in RadEditor

2 posts, 0 answers
  1. Adeel
    Adeel avatar
    18 posts
    Member since:
    Sep 2014

    Posted 30 Oct 2014 Link to this post

    Hello,

    I have used RadListBox and RadEditor for Drag and drop functionality.

    Scenario 1: I dragged "SomeText" from RadListBox and dropped in the RadEditor. When i press BACKSPACE, it only removes the "t" from the dropped Item "SomeText" and it becomes "SomeTex" in the RadEditor.

    What I want is When its is dropped in the editor it should be treated as a complete object and if i press BACKSPACE, the whole item "SomeText" Should be removed from the RadEditor instead of just "t". How Can i do it.. .. ..

    Scenario 2 : Is it possible to drag the item and drop it on the current Mouse position in the RadEditor, instead of Cursor position.

     
  2. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 04 Nov 2014 Link to this post

    Hello Adeel,

    When a simple text element is dropped in editable container, i.e., the editor, it is expected this text to be considered as plain text and be able to be deleted as expected.

    If there is need for this element to be considered as special, additional logic should be implemented for such behavior. The drop event should be handled, and also, the dropped element should be added as Immutable Element. By that this element will be created as non-editable in the editable scope. You can examine this example:
    <telerik:RadEditor runat="server" ID="RadEditor1" EnableImmutableElements="true">
        <Content>
            <div contenteditable="false" unselectable="on">some text</div>
        </Content>
    </telerik:RadEditor>

    You will see that the inserted text element is not editable any more, although it can only be removed by selecting all (Ctrl+A, and delete or backspace). Additional behavior of the Immutable Elements in the RadEditor should be further implemented as a custom solution based on the requirements.

    There is no OOB logic that will allow the whole element to be deleted on one key press.


    As for the second requirement, the editor's content area is a simple HTML document, and such scenario can only be handled via custom JavaScript logic for DOM manipulation. Such matter is discussed in this Stackoverflow forum thread. Implementing this scenario in the RadEditor content area is similar to working with plain HTML documents. Although, in the terms of Editable content, I can only make assumption how such functionality would be designed and how should it act.


    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top