How to get the selected item value from the legend using c#.net

3 posts, 0 answers
  1. Chandu
    Chandu avatar
    7 posts
    Member since:
    Mar 2013

    Posted 05 Apr 2013 Link to this post

    Hi Friends, 

    I have the telerik rad chart,  when i click on  specific item in the Legend it has to redirect to other page with selected item id with query string, can you please help me for this.

    Ex: default.aspx?id=io# 1388249 or  default.aspx?id=io# 1389656

    Thanks in advance


  2. Missing user
    Missing user avatar

    Posted 10 Apr 2013 Link to this post

    Hello Chandu,

    Achieving this functionality is not possible using C# alone. You will have to modify the Attributes property of each legend item by attaching JavaScript code:
    void RadChart1_BeforeLayout(object sender, EventArgs e)
    {
        foreach (var item in this.RadChart1.Legend.Items)
        {
            item.ActiveRegion.Attributes = "onclick='self.location=\"http://www.telerik.com/\"'";
        }
    }
    You can then easily modify the redirect URL to suit your own needs. Note that the BeforeLayout event is when you can access the legend's items at earliest.

    Greetings,
    Ivan N.
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Chandu
    Chandu avatar
    7 posts
    Member since:
    Mar 2013

    Posted 16 Apr 2013 Link to this post

    Thanks Ivan N.

    It's working Fine.

Back to Top