PerformClick method of RadButtonElement is sending next error:
System.InvalidCastException: 'Unable to cast object of type 'System.EventArgs' to type 'System.Windows.Forms.MouseEventArgs'.
Find my code below:
private void btnAddField_Click(object sender, EventArgs e)
{
RadDiagramShape sourceShape = new RadDiagramShape()
{
Text = "source",
Shape = new RoundRectShape(5),
BackColor = Color.Red
};
sourceShape.Position = new Telerik.Windows.Diagrams.Core.Point(150, 100);
radDiagram.AddShape(sourceShape);
sourceShape.IsSelected = true;
RadButtonElement additionalContent = Telerik.WinControls.UI.Diagrams.Primitives.ItemInformationAdorner.GetAdditionalContent(
this.radDiagram.DiagramElement.ItemInformationAdorner) as RadButtonElement;
additionalContent.PerformClick();
}
What I want is to display the SettingsPane automatically when adding a RadDiagramShape item in a RadDiagram
Regards