We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Problem when Add/remove and change offset y of nodes at runtime on a manual layeout diagram

I created a manual diagram .
on run time I added new nodes to the diagram and updated OffsetY of existing nodes .

but the diagram visual look did not changed !!!.

I tried to do refresh but at the documentation there is only tablelayeout refresh or hierarchialLayout refresh but I did not find how to do refresh to the manual layout diagram.






9 Replies

RT Ramya Thirugnanam Syncfusion Team January 2, 2012 07:17 AM UTC

Hi Donna,

With regards to dynamically change the position of the node, call the InvalidateMeasure() and InvalidateArrange() of the DiagramPage after specifying the offset values of the Node as provided in following code snippet.

Code Snippet:
DiagramPage page = diagramView.Page as DiagramPage;
page.InvalidateMeasure();
page.InvalidateArrange();

Please let us know if you have any concerns.
Regards,
Ramya




DO donna January 3, 2012 05:16 AM UTC

I did the same :

DiagramPage page = diagramView.Page as DiagramPage;
page.InvalidateMeasure();
page.InvalidateArrange();

but it does not work.

I created a new manual layout diagram.

than, I created a button "Add new node" , when clicking on the button I add new node to the diagram , but the visual look of the diagram does not changed.

I also change Y offset of other nodes when I add new Node , but Y offset does not changed also.

I also added a new button "Delete node" , diagramModel.Nodes.RemoveAt(i) and it removed from the diagramModel but the visual look of the diagram does not changed.





RT Ramya Thirugnanam Syncfusion Team January 5, 2012 05:19 AM UTC

Hi Donna,

With regards to Problem when Add/remove and change offset y of nodes at runtime, We are unable to reproduce the reported issue. We have created a simple to represent this. Please refer to the sample from the attachment.

If you feel still this issue exists, please get back us with simple sample to reproduce the issue.

Please let us know if you have any concerns
Regards,
Ramya




ManualLayoutDiagram_cc6609f8.zip


DO donna January 5, 2012 12:55 PM UTC

Yes it works when the button is on the diagram .

But In my application it does not work because the diagram is a userControl in a wpf window page. the button "add new node" is on the page and not on the UserControl. when I click on the node it updates the data base first and after that send callback to the usercontrol , and only then I added the new node .

diagramMode.nodes.add(node);

But I cannot see the new node !

the visual look of the diagram did not changed !!!





RT Ramya Thirugnanam Syncfusion Team January 11, 2012 03:40 AM UTC

Hi Donna,

With regards to Problem when Add/remove and change offset y of nodes at runtime, there are many ways to achieve the database interactivity and call back mechanism. So, Please provide us a simple sample to represent your scenario.we would be able to investigate further on this and update you with an appropriate solution.

Please let us know if you have any concerns.
Regards,
Ramya




DO donna January 18, 2012 10:52 AM UTC

Hello,

I sent you a project which has the problem:

I created Page1 and Page 2.

Page1 is empty , Page2 has a manual diagram.

1) Go to page2( click on button "Diagram")
2) Press "Add new node"
3) It works.
4) Than go again to page1.
5) Than go again to page2. ( The diagram created again without the new node , it's ok ).

6) Than press again "Add new node".
7) not ok ! , The node added to the diagrammodel.itemsource but not shown on the screen .



ManualLayoutDiagram_7411be18.zip


RT Ramya Thirugnanam Syncfusion Team January 20, 2012 07:33 AM UTC

Hi Donna,

With regards to Problem when Add/remove and change offset y of nodes at runtime on a manual layout diagram, after analyzing the provided sample we came to know that you are using the Frames for Navigation.

Frame:
Frame is a content control that provides the ability to navigate to and display content. Frame can be hosted within other content, as with other controls and elements.

Problem:
Frame does not store an instance of a content object in navigation history. Instead, Frame creates a new instance of the content object each time it is navigated to by using navigation history. This behavior is designed to avoid excessive memory consumption when large numbers and large pieces of content are being navigated to. Consequently, the state of the content is not remembered from one navigation to the next.

The similar thing is happened when clicking the Button for Navigating to Diagram, it creates new diagramControl (after adding the Newnode).

For storing a state for a piece of content in navigation history, please refer to the following link.

About Frames: http://msdn.microsoft.com/en-us/library/ms750478.aspx#Cookies
Navigation History: http://msdn.microsoft.com/en-us/library/system.windows.navigation.customcontentstate.aspx

Please let us know if you have any concerns.
Regards,
Ramya




DO donna January 22, 2012 07:33 AM UTC

I know that when using frame the diagram is created again .

this is not a problem because in my real application I save the diagram content to database and than each time the page is loaded I create the diagram from the database.

Please look again at the project I sent you.

My problem is that :

1. Enter the diagram page in my application
2. go out from the diagram page ( go to page1)
3. go back to page2 ( diagram page).
4 then press "add new node". the new node is NOT created on the screen . please watch and see.
I need your help as soon as possible .

thanks




RT Ramya Thirugnanam Syncfusion Team January 26, 2012 03:27 AM UTC

Hi Donna,

With regards to Problem when Add/remove and change offset y of nodes at runtime on a manual layout diagram, we are working on this to find the root cause of this reported issue. We will update you with the solution on January 31st 2012. In order to have a better track with this, please create your customer account in Direct Trac and open a new incident so that we will assist you accordingly.

Our Direct Trac support system can be accessed from the following link:

Link: https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

For more information, you can contact our sales team at salessupport@syncfusion.com

Please let us know if you have any concerns.
Regards,
Ramya



Loader.
Live Chat Icon For mobile
Up arrow icon