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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Model Update

Thread ID:





94204 Apr 29,2010 09:23 AM UTC May 20,2010 06:39 AM UTC WinForms 6
Tags: Diagram
Ben Wang
Asked On April 29, 2010 09:23 AM UTC

i'm using Syncfusion Diagram
i make two models, and want to switch them.
but there's some problem.

i make the second model, and set that ..
this.diagram1.Model = model2;

and i add an icon, and move it.
the diagram doesn't update view!!

please help me
thank you ~



Melba Winshia [Syncfusion]
Replied On May 4, 2010 06:23 AM UTC

Hi Ben,

Thank you for contacting Syncfusion Support.

To update model please use the BeginUpdate() and EndUpdate methods.



//Some code here


Please try this and let me know if this helps.


Ben Wang
Replied On May 5, 2010 02:57 AM UTC

thanks for your help.

but it doesn't work.
i call the "this.diagram1.Model.BeginUpdate()"
and "this.diagram1.Model.EndUpdate()"
in Model_PinPointChanged Event.

is sumthing wrong? or something need to do for model's setting?

Ben Wang
Replied On May 6, 2010 01:50 AM UTC

hi Melba:

I think i know what's wrong.

i create one node,
and append it to two different models.

can't the node be appedned in different model?


Melba Winshia [Syncfusion]
Replied On May 11, 2010 01:02 PM UTC

Hi Ben,

You can create a node and append it to two different models. Please refer to the following sample which illustrates this:


Please have a look at the above sample and if still the issue exists, could you please try reproducing in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?


Ben Wang
Replied On May 12, 2010 03:07 AM UTC

hi Melba

it still can't work.
the modified sample code is attached.

please click the button and move the icon.



Melba Winshia [Syncfusion]
Replied On May 20, 2010 06:39 AM UTC

Hi Ben,

We regret for the delayed response.

I am able to see this issue. But this issue can be resolved by using AttachModel method. When you attach a new model, only the newModel is set to view.Model. So it renders only the nodes. The newModel is not set to Controller.Model. So you can't interact with the nodes. Because all the interactive functionalities (Select, move, rotate, resize) are integrated into the DiagramController. If you want to interact with the nodes, then you have to assign the attached model to Controller.Model. But Controller.Model is read-only. So you need to derive DiagramController and hide the Model property and then you can write the set accessor. Please refer to the following code snippet:

private void button1_Click(object sender, EventArgs e)
if (this.newdiagram.Controller.Model == model1)
((CustomDiagramController)this.newdiagram.Controller).Model = this.model2;
if (this.newdiagram.Controller.Model == model2)
((CustomDiagramController)this.newdiagram.Controller).Model = this.model1;



Please refer to the sample in the following link which illustrates this:


Please let me know if this helps.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon