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

Why I load diagram the whole picture zoom in first the zoom out?

1 Answer 51 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 29 Jul 2016, 02:06 PM

hello,when I load diagram use code like this:

                    StreamReader streamReader = new StreamReader(diagramXmlFile);
                    string data = streamReader.ReadToEnd();
                    streamReader.Close();
                    this.ProjectImageDiagram.Load(data);

                    RadDocumentPane diagramPane = new RadDocumentPane();
                    DataTemplate doctabTemplate = (DataTemplate)CRWindow.TryFindResource("doctab");
                    StackPanel docTab = (StackPanel)doctabTemplate.LoadContent();
                   diagramPane.Header = docTab;
                   UserControl diagramUserControl = new UserControl(diagram, true);
                   diagramPane.Content = diagramUserControl;

And I add diagramPane to RadDocking-DocumentHost-RadSplitContainer-RadPaneGroup, but when I run the program and open this pane, I find that the diagram is zoom in first, and then zoom out to fit the window,why?   Hope to answer, Thanks !

1 Answer, 1 is accepted

Sort by
0
Peshito
Telerik team
answered on 02 Aug 2016, 10:37 AM
Hi,

I tried to reproduce this unexpected behavior using the information provided but to no avail. There is not enough info about the diagram's properties set. Attached is the sample project I worked on. Please feel free to make any changes to it and send it back to us so we can reproduce the issue locally. You could also provide a sample runnable project of your own. As this is a forum thread you will need to use a third party web site for files sharing.

Something you could try is to set the diagram's AutoLayout  property to True.

Regards,
Peshito
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Diagram
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Peshito
Telerik team
Share this question
or