Approved
Last Updated: 26 Apr 2018 08:09 by ADMIN
ADMIN
Petar Mladenov
Created on: 27 Jul 2017 08:15
Category: Diagram
Type: Bug Report
0
Diagram: TextShape with background and no Text created by TextTool cannot be selected or deleted
Use TextTool to create shape with no text but with background.

Pressing enter will close the tool. But the shape remains visible, but you cannot neither select it nor delete it with mouse / keyboard.
By design this shape should be removed both from the Shapes collection and from the diagram surface.



 private void diagram_CommandExecuted(object sender, CommandRoutedEventArgs e)
        {
            if (e.Command.Name == "Edit Item")
            {
                foreach (RadDiagramTextShape textShape in this.diagram.ChildrenOfType<RadDiagramTextShape>())
                {
                    if (!this.diagram.Shapes.Contains(textShape))
                    {
                        Canvas parent = textShape.Parent as Telerik.Windows.Controls.Diagrams.DiagramSurface;
                        if (parent != null)
                        {
                            parent.Children.Remove(textShape);
                            this.diagram.ServiceLocator.GetService<Telerik.Windows.Diagrams.Core.ISelectionService<IDiagramItem>>().ClearSelection();
                        }
                    }
                }
            }
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments