PieChart - clicked item as parameter

7 posts, 0 answers
  1. Tomasz Wisniewski
    Tomasz Wisniewski avatar
    14 posts
    Member since:
    Jan 2010

    Posted 12 Aug 2010 Link to this post

    hello,

    I'm using a PieChart in my SL application. I have the interactivity settings set to this:
    <telerik:PieSeriesDefinition.InteractivitySettings>
       <telerik:InteractivitySettings HoverScope="Item" SelectionMode="Single" SelectionScope="Item"/>                                            </telerik:PieSeriesDefinition.InteractivitySettings>

    And then I have the trigger which binds to my ViewModel:
    <telerik:ChartArea LegendName="rightChartLegend">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="ItemClick">
                <nRoute:ExecuteCommandAction Command="{Binding KliknieciePrawo, Source={StaticResource ViewModel}}"
                                             Parameter="{Binding ElementName=rightChart, Path=ClickedItem}"/>
            </i:EventTrigger>
        </i:Interaction.Triggers>
    </telerik:ChartArea>

    But how can I bind the clicked item on the PieChart to be passed to my ViewModel? At least the label of it?
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 17 Aug 2010 Link to this post

    Hello Tomasz,

    Unfortunately currently this is not possible as there are no SelectedItem/SelectedItems properties exposed that can be passed back to the ViewModel. However, we are planning to extend the Selection/Hover Interactivity API for the next official release of the control and we will make sure your scenario is enabled as well with the update.


    Regards,
    Freddie
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Tomasz Wisniewski
    Tomasz Wisniewski avatar
    14 posts
    Member since:
    Jan 2010

    Posted 17 Aug 2010 Link to this post

    I've solved the issue by creating a converter and the values are passed to the ViewModel with no problems :)
  4. Shrinand
    Shrinand avatar
    15 posts
    Member since:
    Oct 2010

    Posted 18 Nov 2010 Link to this post

    Is SelectedItem or SelectedItems collection available to bind to in the latest release of WPF controls?

    What will be a workaround? Can you please post a solution Tomasz?

    Thanks.
  5. Bartholomeo Rocca
    Bartholomeo Rocca avatar
    247 posts
    Member since:
    May 2006

    Posted 19 Nov 2010 Link to this post

    Hello Shrinand,

    I think the ChartArea class exposes SelectedItems / SelectedSeries properties -- you can check them out.


    Greetings,
    Bart.
  6. Shrinand
    Shrinand avatar
    15 posts
    Member since:
    Oct 2010

    Posted 19 Nov 2010 Link to this post

    Thanks for Replying Bartholomeo. But unfortunately there are no such properties. There are SelectItem, SelectItems, SelectSeries functions on ChartArea class.


  7. Bartholomeo Rocca
    Bartholomeo Rocca avatar
    247 posts
    Member since:
    May 2006

    Posted 19 Nov 2010 Link to this post

    Hello,

    I am using the latest version of the control (2010.3.1110.1040) and I definitely see them:).

    Try downloading the latest binaries again.


    Greetings,
    Bart.
Back to Top