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

how does RadDiagram shapeclicked event work?

4 Answers 209 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Ali
Top achievements
Rank 1
Ali asked on 18 Apr 2013, 04:45 AM
Hi

I'm using RadDiagram (Telerik 2012 Q2), I want to detect my selected shape in a rad diagram. There is an event named ShapeClicked in RadDiagram object, but its sender parameter is a raddiagram (I think it should be a rad shape, i.e. the shape which has been clicked), how can I get the clicked/selected shape? Also shape object has a mouseleftbutton down event which can help me do my work, but it seems that this event is raised only for the first shape object created on the diagram

I've inserted a rad color picker in my project that is used to set/change rad diagram shape colors (it works fine) but I want to enable color detection of my SELECTED shape, so that when user selects a shape, the color picker gets its color, what should I do? I'm dynamically adding shapes to my diagram (diagram.items.add)

thanks

4 Answers, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 22 Apr 2013, 07:22 AM
Hi Ali,

 ShapeClicked event will work for you, the Shape clicked is given in "e.Shape" where "e"are the parameters of the event handler. 
As for the ColorPicker/ColorSelector - they provide a SelectedColor property. But the Shapes BackGround is of type Brush, same is true for the BorderBrush and Stroke. You can bind a Color to Brush (brush is represented with a sinlge color) using a Telerik.Windows.Controls.ColorToBrushConverter but the opposite is impossible - you cannot create a Color from a Brush (which is somehow a set of different colors).

Greetings,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Ali
Top achievements
Rank 1
answered on 22 Apr 2013, 02:14 PM
thanks peter, it worked great, I really enjoy using Telerik controls
0
Jorge
Top achievements
Rank 1
answered on 11 Jun 2019, 03:12 PM
How can I do it with code, You can give an example please
0
Petar Mladenov
Telerik team
answered on 12 Jun 2019, 11:19 AM
Hi Jorge,

This is 6 years old thread regarding RadDiagram for Silverlight with a separate question for ColorPicker. Could you please open a new support thread with more details regarding your scenario ? Or specify what do you need to do in code - is it using ShapeClicked somehow or working with ColorPicker / Selector ?

Regards,
Petar Mladenov
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
Ali
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Ali
Top achievements
Rank 1
Jorge
Top achievements
Rank 1
Share this question
or