is it possible to set shape name by UI? I don't see name in Settings Pane. Or can I somehow customize Settings Pane to edit name of shape?
Just make sure that the editing is enabled:
this.radDiagram1.IsEditable = true;
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Dess | Tech Support Engineer, Principal
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
I known you can edit shape text, it's also in SettinsgPane. My question was about shape name, not text. Purpose is to edit diagram template, set names for specific shapes, and then display texts in this shapes in production program. I know I can set shape text to $Variable1 in designer program and then programatically find all texts starting with $ and write them to names after loading diagram in production program, but best will be if user can edit shape name directly in designer program.
Hello, Marian, Thank you for the clarification. The RadDiagramShape.Name property is not intended to be used. That is why there is no appropriate UI for changing its value like for the Text property for example. However, it is possible to customize the settings pane and add an option next to the Text for the Name property. Please refer to the sample code snippet below:
RadDiagramSettingsPane settingsPane = this.radDiagram1.DiagramElement.SettingsPane;
RadTextBox tb = new RadTextBox();
tb.Width = settingsPane.RadTextBoxItemText.Width;
tb.NullText = "Name";
tb.Location = new Point(settingsPane.RadTextBoxItemText.Location.X,settingsPane.RadTextBoxItemText.Location.Y + 30);
tb.TextChanged += tb_TextChanged;
foreach (Control c in settingsPane.RadPageViewPageText.Controls)
if (c != settingsPane.RadTextBoxItemText)
c.Top += 30;
private void tb_TextChanged(object sender, EventArgs e)
if (this.radDiagram1.SelectedItem != null)
RadDiagramShape shape = this.radDiagram1.SelectedItem as RadDiagramShape;
shape.Name = ((RadTextBox)sender).Text;
I believe that it would fit your custom requirement.
thanks, I will try. If Name property is not intended to be used, what's the best way to do this? How can I identify some specific shape without this?
One more question, what's the difference between Shapes and Items collection in RadDiagram? Can diagram have some items that are not shapes?
private void button1_Click(object sender, EventArgs e)
var shape = GetShapeByName("test");
private object GetShapeByName(string name)
foreach (RadDiagramShape s in this.radDiagram1.Shapes)
RadDiagram doesn't offer such kind of accessing its shapes. It is possible either to use the Shapes[index] approach or traverse the collection and look for the desired Name. Feel free to use this approach which suits your scenario best.