I am working on a project in which RadDiagramShape is generated dynamically in foreach loop.
I need to change text of each Shape at each second. For that i need to access the Shape object by its name property which is unique.
How to i get RadDiagramShape object by its name?
1 Answer, 1 is accepted
0
Hristo
Telerik team
answered on 23 May 2017, 04:02 PM
Hi Sachin,
Thank you for writing.
The shapes are stored in a ShapeCollection object which is exposed by the RadDiagram.Shapes property. The ShapeCollection class inherits the System.Collections.ObjectModel.ReadOnlyCollection<T> class which cannot be enumerated by name.
I can suggest to iterate your collection and search for the shape by its Name or use LINQ:
var shape = this.radDiagram1.Shapes.Where(s => s.Name == "YourName").FirstOrDefault();
I hope this helps. Should you have further questions please do not hesitate to write back.