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

Model not getting to custom editor

5 Answers 123 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Miguel
Top achievements
Rank 1
Miguel asked on 15 Apr 2016, 06:54 PM

Hi!

I made an editor template since I couldn't get the labels of the automatic editor to show up properly (they always show in lowercase, can't they pick up the DisplayName data annotation of the model?).

The issue is that it seems the model object isn't getting into the editor. For example:

If I edit a connector with the default automatic editor, I get a nice list for the "from/to" fields, with all the nodes in the diagram, which works perfectly. Now, if I want to replicate the same behaviour for my custom editor but I can't get them to show.

How can I set up my editor template so it picks up the shapes in the diagram?

5 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 19 Apr 2016, 11:55 AM
Hello Miguel,

You can log an improvement about the casing of the connections editing in our uservoice portal. Regarding the custom editing could you please provide a runnable example where the issue is reproducible, so that we can investigate it further?

Regards,
Danail Vasilev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Miguel
Top achievements
Rank 1
answered on 20 Apr 2016, 07:53 PM

Eh I can give you the view, a complete example goes beyond a few hundred lines of code : /

As I said, all you need to view the issue is to try to add a custom editor template to the connector and try to emulate the "from" and "to" drop down lists, like the ones from this example: http://demos.telerik.com/aspnet-mvc/diagram/editing

 As you can see, they get filled with the present shapes in the automatic editor, whereas I can't seem to be able to emulate the same behavior from a custom editor template.

Also, say that in that custom editor I want to make changes to a nested object, how would I go about that? Say that I have a "Node" model that has a "Data" instance with miscellaneous fields inside it, how could I make an editor template that lets me edit the Data fields?

0
Miguel
Top achievements
Rank 1
answered on 21 Apr 2016, 02:27 PM
I've solved the nested object issue, turns out that like some other fields, if I dont set a default value for it, the editor template gets a null model object and can't do anything about it.
0
Miguel
Top achievements
Rank 1
answered on 21 Apr 2016, 02:28 PM
The issue with the connector remains though.
0
Danail Vasilev
Telerik team
answered on 22 Apr 2016, 01:44 PM
Hello Miguel,

The file in the attachment is an empty file. Could you please try reattaching it?

Regards,
Danail Vasilev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Diagram
Asked by
Miguel
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Miguel
Top achievements
Rank 1
Share this question
or