This is a migrated thread and some comments may be shown as answers.

Need to disable rotate and resize

3 Answers 98 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Timothy
Top achievements
Rank 1
Timothy asked on 08 Feb 2015, 05:35 PM
How can I disable all rotate and resize functionality for radDiagram shapes?

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 11 Feb 2015, 05:44 PM
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
0
Chance
Top achievements
Rank 1
answered on 05 May 2015, 08:55 PM
Is it possible to configure the editable and selectable properties for individual shapes instead of the entire diagram?
1
Vessy
Telerik team
answered on 06 May 2015, 08:16 AM
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
Tags
Diagram
Asked by
Timothy
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Chance
Top achievements
Rank 1
Share this question
or