7 Answers, 1 is accepted
I am able to post-back to the server the diagram's json object.
Although I able to go through one-by-one the diagram's shape & connection properties in the "result" dynamic variable :
I was wondering if there's an easier way to populate the fields back to a server object.
I'm trying the following, but can't seem how to make it work:
Please help how to use the "Converter", I see several of them, for DiagramShapeConverter, DiagramShapeConnectorConverter, etc
RadDiagram is entirely client-side designed control and changes that occur on the client are not persisted somehow to the server. I am afraid, also, that there is no easy workaround for that to work.
The only possible approach I can think of is to save and reload the JSON data of the RadDiagram—http://demos.telerik.com/aspnet-ajax/diagram/examples/saveload/defaultcs.aspx.
I tried the following but got an error, please see below
An exception of type 'System.Exception' occurred in Telerik.Web.UI.dll but was not handled in user code
I wish to convert the json string back to a new RadDiagram server-side object
- as RadDiagram server-side object doesn't seem to retain any changes made by the user (e.g move shape, .. x y coordinates does not update).
Thanks for your feedback. Yes, it is indeed a client-side control.
Just wondering how to use the RadDiagramConverter ,
- what is for
- any sample code you can provide me ?
RadDiagramConverter is a helper class that is used internally in RadDiagram to serialize some diagram options to the client.
Its design is not to be used in a custom solution with diagram and I don't see how it could be useful in your scenario.
Thanks Ianko. I've managed to do a work-around to persist any client-side changes (e.g. shape's x & y axis movement) to the server by (1) save raddiagram's json to hidden field (2) access hidden field's json and re-build raddiagram.
A bit crude, but seems to work. Any future plans to make this control more server side? Use case would be to do server-side business rule processing after user creates a shape or connect shapes.
some sample code below for sharing :