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

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

2 Answers 68 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chandu
Top achievements
Rank 1
Chandu asked on 05 Apr 2013, 06:51 PM
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 Answers, 1 is accepted

Sort by
0
Missing User
answered on 10 Apr 2013, 08:49 AM
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.
0
Chandu
Top achievements
Rank 1
answered on 16 Apr 2013, 10:48 AM
Thanks Ivan N.

It's working Fine.

Tags
General Discussions
Asked by
Chandu
Top achievements
Rank 1
Answers by
Missing User
Chandu
Top achievements
Rank 1
Share this question
or