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

RadDiagram with images programatically

1 Answer 205 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Miguel Angel
Top achievements
Rank 1
Iron
Miguel Angel asked on 11 Jul 2017, 04:04 AM

Hi,

I'm trying to create a diagram with images programatically, I followed the demo  http://demos.telerik.com/aspnet-ajax/diagram/examples/serverside/defaultcs.aspx and its ok. The problem is that the image only shows in the first shape.

 

The code is

 

<telerik:RadDiagram  runat="server" ID="diagrama" >
   <LayoutSettings  Type="Tree" Subtype="Right"/>
   <ShapeDefaultsSettings Type="Circle"/>
 </telerik:RadDiagram>

 

And .Net

for (int i = 0; i < 4; i++)
{
   DiagramShape nodo = new DiagramShape();
   nodo.Id = i.ToString();
   String contenido = "<label>" + i.ToString() + "</Label>";
   contenido += "<img src='FacturaPagada.png' />";
   nodo.ContentSettings.Html = contenido;
   diagrama.ShapesCollection.Add(nodo);
 }

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 17 Jul 2017, 12:06 PM
Hi Miguel,

Thank a lot for sharing reporting this issue with us. I managed to reproduce it and logged it into our back-log system for a further investigation. You can track its progress and vote in order to increase its priority in the following item:
https://feedback.telerik.com/Project/108/Feedback/Details/222753

Your Telerik points also have been updated accordingly.

Meanwhile, you can workaround the problem either by using different images for each shape, or by adding the images client-side by implementing Visual template for the shapes:
http://docs.telerik.com/devtools/aspnet-ajax/controls/diagram/functionality/shape-templates

Regards,
Vessy
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Diagram
Asked by
Miguel Angel
Top achievements
Rank 1
Iron
Answers by
Vessy
Telerik team
Share this question
or