Approved
Last Updated: 21 Nov 2016 12:33 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Bug Report
1

			
Completed
Last Updated: 09 Nov 2016 13:50 by ADMIN
How to reproduce: 

 public partial class Form1 : Form
 {
     public Form1()
     {
         InitializeComponent();

         RadDiagramShape shape1 = new RadDiagramShape()
         {
             Text = "Second Level Domain",
             ElementShape = new RoundRectShape(4),
             BackColor = Color.LimeGreen
         };
         shape1.Position = new Telerik.Windows.Diagrams.Core.Point(100, 100);
         radDiagram1.Items.Add(shape1);

         var res = radDiagram1.Items[0];
         ((Telerik.WinControls.UI.Diagrams.RadDiagramItem)shape1).EndEdit += item_EndEdit;

         RadDiagramShape shape2 = new RadDiagramShape()
         {
             Text = "Top Level Domain",
             ElementShape = new RoundRectShape(50),
             BackColor = Color.Cyan
         };
         shape2.Position = new Telerik.Windows.Diagrams.Core.Point(1600, 100);

         radDiagram1.Items.Add(shape2);

         RadDiagramShape shape3 = new RadDiagramShape()
         {
             Text = "Organization Domain",
             ElementShape = new RoundRectShape(20),
             BackColor = Color.Yellow
         };
         shape3.Position = new Telerik.Windows.Diagrams.Core.Point(2400, 100);
         radDiagram1.Items.Add(shape3);

         RadDiagramConnection connection1 = new RadDiagramConnection() { Name = "connection1" };
         connection1.Source = shape1;
         connection1.Target = shape2;
         radDiagram1.Items.Add(connection1);

         RadDiagramConnection connection2 = new RadDiagramConnection()
         {
             Name = "connection2"
         };
         connection2.Source = shape2;
         connection2.Target = shape3;
         radDiagram1.Items.Add(connection2);
     }

     private void item_EndEdit(object sender, Telerik.WinControls.UI.Diagrams.RadRoutedEditEventArgs e)
     {
         RadDiagramShape shape = ((RadDiagramShape)sender);
         string txt = shape.Text;
         Size size = TextRenderer.MeasureText(txt, shape.Font, new System.Drawing.Size( (int)shape.Width, int.MaxValue ), ~TextFormatFlags.SingleLine);

         shape.Height = size.Height;
     }

     private void radButton1_Click(object sender, EventArgs e)
     {
         this.radDiagram1.DiagramElement.BringIntoView(radDiagram1.Items[0], this.radDiagram1.Zoom, false);
     }

     private void radButton2_Click(object sender, EventArgs e)
     {
         this.radDiagram1.DiagramElement.BringIntoView(radDiagram1.Items[1], this.radDiagram1.Zoom, false);
     }

     private void radButton3_Click(object sender, EventArgs e)
     {
         this.radDiagram1.DiagramElement.BringIntoView(radDiagram1.Items[2], this.radDiagram1.Zoom, false);
     }
 }

Workaround:  manually update the view
private void radButton1_Click(object sender, EventArgs e)
{
    this.radDiagram1.DiagramElement.BringIntoView(radDiagram1.Items[0], this.radDiagram1.Zoom, false);
    this.radDiagram1.DiagramElement.Controller.OnViewportChanged();
}

private void radButton2_Click(object sender, EventArgs e)
{
    this.radDiagram1.DiagramElement.BringIntoView(radDiagram1.Items[1], this.radDiagram1.Zoom, false);
    this.radDiagram1.DiagramElement.Controller.OnViewportChanged();
}

private void radButton3_Click(object sender, EventArgs e)
{
    this.radDiagram1.DiagramElement.BringIntoView(radDiagram1.Items[2], this.radDiagram1.Zoom, false);
    this.radDiagram1.DiagramElement.Controller.OnViewportChanged();
}

Completed
Last Updated: 10 Oct 2016 06:21 by ADMIN
To reproduce:
- Add shape and zoom the view.
- Call the method:
radDiagram1.DiagramElement.BringIntoView(radDiagram1.Shapes[0]);

Workaround:
radDiagram1.DiagramElement.BringIntoView(radDiagram1.Shapes[0],radDiagram1.Zoom, false);          
Completed
Last Updated: 06 Oct 2016 13:40 by ADMIN
To reproduce:
- Zoom the diagram and drop an item from the toolbox. 

Workaround:
Friend Class MyToolbox
    Inherits RadDiagramToolbox
  
    Protected Overrides Sub DragDropService_PreviewDragDrop(ByVal sender As Object, ByVal e As RadDropEventArgs)
        'base.DragDropService_PreviewDragDrop(sender, e);
        Dim shape = TryCast(GetType(RadDiagramToolbox).GetField("shape", System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.Instance).GetValue(Me), RadDiagramShape)
  
        Dim diagramElement As RadDiagramElement = TryCast(e.HitTarget, RadDiagramElement)
        Dim containerShape As RadDiagramContainerShape = TryCast(e.HitTarget, RadDiagramContainerShape)
        If containerShape IsNot Nothing Then
            diagramElement = containerShape.FindAncestor(Of RadDiagramElement)()
        End If
  
        If diagramElement Is Nothing OrElse diagramElement.Shape IsNot Nothing OrElse shape Is Nothing Then
            Return
        End If
  
        e.Handled = True
        Dim zoom As Double = diagramElement.Zoom
        Dim m As Telerik.WinControls.Layouts.RadMatrix = diagramElement.MainPanel.Transform
        m.Invert()
  
        Dim position = New Telerik.Windows.Diagrams.Core.Point(m.DX + (e.DropLocation.X - shape.Width \ 2) * 1 / zoom, m.DY + (e.DropLocation.Y - shape.Height \ 2) * 1 / zoom)
        If containerShape IsNot Nothing Then
            position.X += containerShape.Position.X
            position.Y += containerShape.Position.Y
        End If
  
        shape.Position = position
        diagramElement.AddShape(shape, Nothing, True)
        If containerShape IsNot Nothing Then
            DirectCast(containerShape, IContainerShape).AddItem(shape)
        End If
  
        shape = Nothing
    End Sub
End Class
Completed
Last Updated: 09 Nov 2016 07:33 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Bug Report
1
The user is not allowed to add a shape or edit an existing one by using the TextTool: http://docs.telerik.com/devtools/winforms/diagram/diagram-tools/text-tool

Workaround:

 Me.RadDiagramRibbonBar1.buttonTextTool.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
Approved
Last Updated: 04 Oct 2016 08:20 by ADMIN
ADMIN
Created by: Dimitar
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Feature Request
1

			
Approved
Last Updated: 04 Oct 2016 06:27 by ADMIN
Completed
Last Updated: 27 Sep 2016 07:15 by ADMIN
To reproduce:
- Add some shapes and call the BringToView method
Private Sub RadButton4_Click(sender As Object, e As EventArgs) Handles RadButton4.Click
    Dim ds As RadDiagramShape
    For i As Integer = 0 To Me.RadDiagram1.Shapes.Count - 1
        If i = 2 Then
            ds = DirectCast(RadDiagram1.Shapes(i), RadDiagramShape)
            Me.RadDiagram1.DiagramElement.BringIntoView(ds, 1.0, True)
            Exit For
        End If
    Next
End Sub

Workaround:
Me.RadDiagram1.DiagramElement.BringIntoView(ds, 1.0, False)
Completed
Last Updated: 03 Aug 2017 07:41 by ADMIN
ADMIN
Created by: Dimitar
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Bug Report
1
To reproduce:
- Add some connections and zoom.
- Click a connection
- The event is not fired.

Workaround:
Friend Class MyInputBehaviour
    Inherits DiagramInputBehavior

    Public Sub New(ByVal element As RadDiagramElement)
        MyBase.New(element)
    End Sub
    Public Overrides Function HandleMouseUp(ByVal e As MouseEventArgs) As Boolean
        '  return base.HandleMouseUp(e);
        If Me.DiagramElement.ElementTree.Control.Site IsNot Nothing Then
            Return False
        End If
        Dim elementUnderMouse As RadElement = Me.DiagramElement.ElementTree.GetElementAtPoint(e.Location)
        If Me.IsScrollBar(elementUnderMouse) Then
            Return False
        End If

        If TypeOf elementUnderMouse Is RadButtonElement Then
            Return False
        End If

        Dim position = e.Location

        Dim transform As Telerik.WinControls.Layouts.RadMatrix = Me.DiagramElement.MainPanel.TotalTransform
        transform.Invert()

        Dim transformedPosition = transform.TransformPoint(position)

        Dim service = Me.DiagramElement.Controller.ServiceLocator.GetService(Of IHitTestService)()
        Dim conectionUnderPoint = TryCast(service.GetItemsNearPoint(transformedPosition, DiagramConstants.SelectionHitTestRadius).Where(Function(i) TypeOf i Is IConnection).OrderByDescending(Function(x) x.ZIndex).FirstOrDefault(), IConnection)


        If conectionUnderPoint IsNot Nothing Then
            DirectCast(Me.DiagramElement, IGraphInternal).PublishDiagramEvent(DiagramEvent.ConnectionClicked, New GenericEventArgs(Of IConnection)(conectionUnderPoint, e))
        End If


        Dim mi = Me.DiagramElement.GetType().GetMethod("UpdateFocusedElement", System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic)
        mi.Invoke(Me.DiagramElement, Nothing)

        Return False
    End Function
End Class

Change like this:
RadDiagram1.DiagramElement.InputBehavior = New MyInputBehaviour(RadDiagram1.DiagramElement)
Completed
Last Updated: 13 Feb 2017 09:26 by ADMIN
ADMIN
Created by: Dimitar
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Bug Report
1
To reproduce:
- Add some shapes and zoom so only one is visible.
- Export to image.
- The image size is not correct.

Workaround:
private const int InflateValue = 7;
public System.Drawing.Image ExportToImage()
{
    RadDiagramElement diagram = radDiagram1.DiagramElement;
    var enclosingBounds = diagram.CalculateEnclosingBounds();

    using (Bitmap image = new Bitmap((int)(Math.Abs(enclosingBounds.Right) + InflateValue + Math.Abs( enclosingBounds.Left)), (int)(Math.Abs(enclosingBounds.Bottom) + InflateValue + Math.Abs(enclosingBounds.Top))))
    {
        System.Drawing.Graphics nativeGraphics = System.Drawing.Graphics.FromImage(image);
        nativeGraphics.FillRectangle(new System.Drawing.SolidBrush(diagram.ElementTree.RootElement.BackColor), 0, 0, image.Width, image.Height);
        Telerik.WinControls.Paint.RadGdiGraphics radGdi = new Telerik.WinControls.Paint.RadGdiGraphics(nativeGraphics);
        foreach (RadElement element in diagram.ItemsHost.GetChildren(ChildrenListOptions.ZOrdered))
        {
            element.Paint(radGdi, new System.Drawing.Rectangle(int.MinValue / 2, int.MinValue / 2, int.MaxValue, int.MaxValue), 0f, new System.Drawing.SizeF(1, 1), true);
        }

        System.Drawing.Image img = (System.Drawing.Image)image.Clone();
        nativeGraphics.Dispose();
        radGdi.Dispose();
        return img;
    }
}
Completed
Last Updated: 19 Aug 2016 09:37 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Bug Report
0
To reproduce:

public Form1()
{
    InitializeComponent();

    this.radDiagram1.SelectionMode = Telerik.Windows.Diagrams.Core.SelectionMode.None;
    PopulateWithData();
}

private void PopulateWithData()
{
    DataTable tasksTable = new DataTable("Tasks");   
    tasksTable.Columns.Add("Id");
    tasksTable.Columns.Add("Text");
    tasksTable.Columns.Add("Type");
    tasksTable.Columns.Add("X");
    tasksTable.Columns.Add("Y");
    tasksTable.Columns.Add("Width");
    tasksTable.Columns.Add("Height");
    tasksTable.Rows.Add("Task1", "Task 1", "circle", 100, 300, 50, 50);
    tasksTable.Rows.Add("Task2", "Task 2", "rectangle", 200, 100, 100, 100);
    tasksTable.Rows.Add("Task3", "Task 3", "circle", 300, 300, 50, 50);
    tasksTable.Rows.Add("Task4", "Task 4", "rectangle", 400, 100, 100, 100);
    tasksTable.Rows.Add("Task5", "Task 5", "circle", 500, 300, 50, 50);

    DataTable relationsTable = new DataTable("Relations");
    relationsTable.Columns.Add("SourceTaskId");
    relationsTable.Columns.Add("SourceConnector");
    relationsTable.Columns.Add("TargetTaskId");
    relationsTable.Columns.Add("TargetConnector");
    relationsTable.Columns.Add("StartCapField");
    relationsTable.Columns.Add("EndCapField");
    relationsTable.Rows.Add("Task2", "Left", "Task1", "Auto", "Arrow5Filled", "Arrow1");
    relationsTable.Rows.Add("Task2", "Auto", "Task3", "Auto", "Arrow4Filled", "Arrow1Filled");
    relationsTable.Rows.Add("Task4", "Auto", "Task5", "Auto", "Arrow2Filled", "Arrow2");

    DataSet ds = new DataSet();
    ds.Tables.Add(tasksTable);
    ds.Tables.Add(relationsTable);

    this.radDiagram1.DataSource = ds;

    this.radDiagram1.ConnectionDataMember = "Relations";
    this.radDiagram1.ShapeDataMember = "Tasks";
    this.radDiagram1.ShapeIdMember = "Id";  
    this.radDiagram1.ShapeTextMember = "Text";
    this.radDiagram1.ShapeTypeMember = "Type";
    this.radDiagram1.ShapeXMember = "X";
    this.radDiagram1.ShapeYMember = "Y";
    this.radDiagram1.ShapeWidthMember = "Width";
    this.radDiagram1.ShapeHeightMember = "Height";

    this.radDiagram1.ConnectionSourceShapeIdMember = "SourceTaskId";
    this.radDiagram1.ConnectionTargetShapeIdMember = "TargetTaskId";
    this.radDiagram1.ConnectionSourceCapTypeMember = "StartCapField";
    this.radDiagram1.ConnectionTargetCapTypeMember = "EndCapField";

    this.radDiagram1.ConnectionSourceConnectorMember = "SourceConnector";
    this.radDiagram1.ConnectionTargetConnectorMember = "TargetConnector";
}

Workaround: after rebinding, clear the selection and set the SelectionMode to None:

PopulateWithData();
this.radDiagram1.SelectedItem = null;
this.radDiagram1.SelectionMode = Telerik.Windows.Diagrams.Core.SelectionMode.None;
Approved
Last Updated: 19 Aug 2016 11:59 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Bug Report
2
Please refer to the attached gif file illustrating how to reproduce the problem.

Workaround: use the following approach for exporting to an image:

private void radButton1_Click(object sender, EventArgs e)
{
    RadScrollBarElement horizontalScrollBar = this.radDiagram1.DiagramElement.Children[1] as RadScrollBarElement;
    RadScrollBarElement verticalScrollBar = this.radDiagram1.DiagramElement.Children[2] as RadScrollBarElement;

    
    this.Size = new System.Drawing.Size(this.Size.Width + (horizontalScrollBar.Maximum - this.radDiagram1.Size.Width),
        this.Size.Height + (verticalScrollBar.Maximum + 1 - this.radDiagram1.Height));
    Application.DoEvents();
    Bitmap bmp = new Bitmap(radDiagram1.Width, radDiagram1.Height, PixelFormat.Format32bppArgb);
   
    this.radDiagram1.DrawToBitmap(bmp, new Rectangle(0, 0, radDiagram1.Width, radDiagram1.Height));
  
    bmp.Save(@"..\..\test2.bmp");
    System.Diagnostics.Process.Start(@"..\..\test2.bmp");
}
Completed
Last Updated: 05 May 2016 06:42 by ADMIN
ADMIN
Created by: Dimitar
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Bug Report
0
To reproduce:
- Add shape to the diagram.
- Select the shape. 
- Press and hold Ctrl, then press one of the arrow keys.
- The shape is not moved.

Workaround:
private void RadDiagram1_KeyDown(object sender, KeyEventArgs e)
{
   // Ctrl should be pressed as well.
    if (e.KeyCode == Keys.Left)
    {
        var shape = radDiagram1.SelectedItem as RadDiagramShape;
        if (shape != null)
        {
            shape.Position = new Telerik.Windows.Diagrams.Core.Point(shape.Position.X - 10, shape.Position.Y);
        }
    }
}
Approved
Last Updated: 15 Aug 2017 10:02 by ADMIN
ADMIN
Created by: Stefan
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Feature Request
0

			
Completed
Last Updated: 13 Oct 2015 11:24 by ADMIN
To reproduce:

public Form1()
{
    InitializeComponent();

    RadDiagramShape shape = new RadDiagramShape();
    shape.Text = "Shape1";
    shape.AllowCopy = false;
    shape.AllowPaste = false;
    shape.AllowDelete = false;
    shape.AllowCut = false;
    shape.Position = new Telerik.Windows.Diagrams.Core.Point(50, 50);
    shape.BackColor = Color.Red;
    this.radDiagram1.AddShape(shape);
}

Workaround: Hide the first tab in the SettinsgPane as it is demonstrated in the following article: http://www.telerik.com/help/winforms/diagram-settings-pane.html
Completed
Last Updated: 21 Oct 2015 06:41 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Feature Request
0

			
Completed
Last Updated: 08 Sep 2015 15:03 by ADMIN
ADMIN
Created by: Stefan
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Bug Report
0
To reproduce:
radDiagram1.SelectedItem = radDiagram1.Shapes[2];

Workaround:
radDiagram1.Shapes[2].IsSelected = true;
Completed
Last Updated: 14 Jul 2015 12:17 by ADMIN
Completed
Last Updated: 23 Jul 2015 13:04 by ADMIN
Note: this behavior may be applied to all other relevant manipulation properties

To reproduce:

            this.radDiagram1.IsDraggingEnabled = true;
            RadDiagramShape shape1 = new RadDiagramShape();
            shape1.Text = "Shape1";
            shape1.BackColor = Color.Red;
            shape1.IsDraggingEnabled = false;
            shape1.ElementShape = new RoundRectShape(5);
            this.radDiagram1.Items.Add(shape1);

As a result you will be able to drag the shape which is not correct.

Workaround: set the RadDiagramShape.IsDraggingEnabled  after the shape is added to the diagram:

this.radDiagram1.IsDraggingEnabled = true;
RadDiagramShape shape1 = new RadDiagramShape();
shape1.Text = "Shape1";
shape1.BackColor = Color.Red;         
shape1.ElementShape = new RoundRectShape(5);
this.radDiagram1.Items.Add(shape1);
shape1.IsDraggingEnabled = false;
Completed
Last Updated: 09 Sep 2015 12:09 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: Diagram, DiagramRibbonBar, DiagramToolBox
Type: Bug Report
0
Please refer to the attached gif file.

Workaround:  cancel the PreviewPan event and adjust manually the  Telerik.WinControls.UI.Diagrams.Panel.PositionOffset. Here is demonstrated a sample approach:
int widthOffset = -1000;
int heightOffset = -1000;

private void radDiagram_PreviewPan(object sender, Telerik.WinControls.UI.Diagrams.PositionChangedRoutedEventArgs e)
{
    Telerik.WinControls.UI.Diagrams.Panel panel = this.radDiagram.DiagramElement.Children.First() as Telerik.WinControls.UI.Diagrams.Panel;
    Telerik.WinControls.UI.Diagrams.Panel hitTestablePanel = panel.Children.First() as Telerik.WinControls.UI.Diagrams.Panel;

    e.Cancel = true;
    if (panel != null)
    {
        hitTestablePanel.PositionOffset = new SizeF(widthOffset,heightOffset);
        widthOffset += 50;
    }
}