|
| 1 | +--- |
| 2 | +title: Add draggable scrollbars in RadDiagram |
| 3 | +description: Draggable scrollbars in RadDiagram |
| 4 | +type: how-to |
| 5 | +page_title: Use Draggable Scrollbars in RadDiagram |
| 6 | +slug: diagram-scrollbars |
| 7 | +position: |
| 8 | +tags: |
| 9 | +ticketid: 1375484 |
| 10 | +res_type: kb |
| 11 | +--- |
| 12 | + |
| 13 | +## Description |
| 14 | +How can I implement scrollbars in the RadDiagram for ASP.NET AJAX? |
| 15 | + |
| 16 | +## Solution |
| 17 | +The following example demonstrates how to use a scrollbar as a Diagram element. |
| 18 | + |
| 19 | +````ASP.NET |
| 20 | +<div style="overflow: auto; width: 1000px; height: 300px;"> |
| 21 | + <telerik:RadDiagram ID="RadDiagram1" runat="server" Editable="false" Pannable="false" ZoomRate="0"> |
| 22 | + <ClientEvents OnLoad="onDataBound" /> |
| 23 | + <ShapesCollection> |
| 24 | + <telerik:DiagramShape Id="s1" X="700" Y="100"></telerik:DiagramShape> |
| 25 | + <telerik:DiagramShape Id="s2" X="200" Y="300"></telerik:DiagramShape> |
| 26 | + <telerik:DiagramShape Id="s3" X="700" Y="300"></telerik:DiagramShape> |
| 27 | + <telerik:DiagramShape Id="s4" X="1200" Y="300"></telerik:DiagramShape> |
| 28 | + </ShapesCollection> |
| 29 | + <ConnectionsCollection> |
| 30 | + <telerik:DiagramConnection> |
| 31 | + <FromSettings ShapeId="s1" /> |
| 32 | + <ToSettings ShapeId="s2" /> |
| 33 | + </telerik:DiagramConnection> |
| 34 | + <telerik:DiagramConnection> |
| 35 | + <FromSettings ShapeId="s1" /> |
| 36 | + <ToSettings ShapeId="s3" /> |
| 37 | + </telerik:DiagramConnection> |
| 38 | + <telerik:DiagramConnection> |
| 39 | + <FromSettings ShapeId="s1" /> |
| 40 | + <ToSettings ShapeId="s4" /> |
| 41 | + </telerik:DiagramConnection> |
| 42 | + </ConnectionsCollection> |
| 43 | + </telerik:RadDiagram> |
| 44 | +</div> |
| 45 | +```` |
| 46 | + |
| 47 | +````JavaScript |
| 48 | +<script> |
| 49 | + function onDataBound(diagram, args) { |
| 50 | + var kendoDiagram = diagram.get_kendoWidget(); |
| 51 | + var bbox = kendoDiagram.boundingBox(); |
| 52 | + |
| 53 | + kendoDiagram.wrapper.width(bbox.width + bbox.x + 50); |
| 54 | + kendoDiagram.wrapper.height(bbox.height + bbox.y + 50); |
| 55 | + kendoDiagram.resize(); |
| 56 | + } |
| 57 | +</script> |
| 58 | +```` |
| 59 | + |
| 60 | +## See Also |
| 61 | + |
| 62 | +[Use Scrollbars in the Kendo UI Diagram widget](https://docs.telerik.com/kendo-ui/knowledge-base/using-scrollbar) |
| 63 | + |
| 64 | + |
0 commit comments