how does RadDiagram shapeclicked event work?

3 posts, 1 answers
  1. Ali
    Ali avatar
    15 posts
    Member since:
    Jul 2012

    Posted 17 Apr 2013 Link to this post

    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
  2. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 22 Apr 2013 Link to this post

    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.

  3. DevCraft banner
  4. Ali
    Ali avatar
    15 posts
    Member since:
    Jul 2012

    Posted 22 Apr 2013 Link to this post

    thanks peter, it worked great, I really enjoy using Telerik controls
Back to Top