Need to disable rotate and resize

4 posts, 0 answers
  1. Timothy
    Timothy avatar
    75 posts
    Member since:
    Oct 2010

    Posted 08 Feb 2015 Link to this post

    How can I disable all rotate and resize functionality for radDiagram shapes?
  2. Vessy
    Admin
    Vessy avatar
    1383 posts

    Posted 11 Feb 2015 Link to this post

    Hi Timothy,

    A possible way to disable the rotate and resize functionality of RadDiagram is to configure its Selectable and Editable properties:
    <telerik:RadDiagram ID="brackets" runat="server" Width="900" Height="500" Selectable="false" >
        <ShapeDefaultsSettings Editable="false"></ShapeDefaultsSettings>
        <LayoutSettings Enabled="true" Type="Tree"></LayoutSettings>
        <ShapesCollection>
            <telerik:DiagramShape Id="s1"></telerik:DiagramShape>
            <telerik:DiagramShape Id="s2"></telerik:DiagramShape>
        </ShapesCollection>
        <ConnectionsCollection>
            <telerik:DiagramConnection>
                <FromSettings ShapeId="s1" />
                <ToSettings ShapeId="s2" />
            </telerik:DiagramConnection>
        </ConnectionsCollection>
    </telerik:RadDiagram>

    Note, though, that the configuration above will also disable the shapes/connections move functionality.

    Regards,
    Vessy
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Chance
    Chance avatar
    4 posts
    Member since:
    Apr 2015

    Posted 05 May 2015 in reply to Vessy Link to this post

    Is it possible to configure the editable and selectable properties for individual shapes instead of the entire diagram?
  5. Vessy
    Admin
    Vessy avatar
    1383 posts

    Posted 06 May 2015 Link to this post

    Hi Chance,

    The Editable property is exposed for every shape and you can configure it through the markup. The selectable property, though, can be configured only through the Kendo API for the moment. For example:
    <telerik:RadDiagram ID="diagram1" runat="server" Width="900" Height="500">
        <LayoutSettings Enabled="true" Type="Tree"></LayoutSettings>
        <ClientEvents OnLoad="diagramLoad" />
        <ShapesCollection>
            <telerik:DiagramShape Id="s1" Editable="false">
            </telerik:DiagramShape>
            <telerik:DiagramShape Id="s2"></telerik:DiagramShape>
        </ShapesCollection>
        <ConnectionsCollection>
            <telerik:DiagramConnection>
                <FromSettings ShapeId="s1" />
                <ToSettings ShapeId="s2" />
            </telerik:DiagramConnection>
        </ConnectionsCollection>
    </telerik:RadDiagram>
    <script>
        function diagramLoad(diagram, args) {
            diagram.get_kendoWidget().getShapeById("s1").options.selectable = false;
        }
    </script>

    I hope this helps.

    Regards,
    Vessy
    Telerik
Back to Top