Passing a Parameter when drilling down a Bar Chart

Thread is closed for posting
2 posts, 0 answers
  1. Tom
    Tom avatar
    1 posts
    Member since:
    Jun 2013

    Posted 03 Jun 2013 Link to this post


    I work for a UN organisation, where I am trying to create a dashboard, where a manager can drill into details about staff based on the kind of salary system they are on.

    I have attached the chart I have created, for reference.

    This chart I populate with a data source created declaratively in the .aspx file. I the chart in crated with a group by base in the salary system.

    This creates the chart as is seen in the attachment. it automatically puts in the text codes for the salary system, for each column. cool functionality BTW, thank you! Now, I would like to create the drilldown, so that if a user clicks a column, then he/she gets details information about the distribution, of what is called grades, within each salary system.

    For that I have created a second data source, with the same Control parameter that is used for the initial chart, this is a country, selected from a dropdown list, and a additional parameter, that I would like to be the text that is located below each of the columns.

    I assumed that I could use the below code, to fill in that parameter:
    protected void MyRadChart_Click(object sender, Telerik.Charting.ChartClickEventArgs args)
            if (args.SeriesItem != null)
                staffCountByGrade.SelectParameters[1].DefaultValue = args.SeriesItem.Name;
                MyRadChart.DataSourceID = "staffCountByGrade";
     The SelectParameter[0] comes from the dropdown list.

    What I get is text lie Item 1, Item 2, and so on. Is the no way I can get at the text that the chart has automatically put in from the initial data source?
  2. Rosko
    Rosko avatar
    137 posts

    Posted 06 Jun 2013 Link to this post

    Hello Tom,

    Thank you for the detailed explanation. You are on the right track.

    In the same event before you set the DataSourceID property you need to set MyRadChart.PlotArea.XAxis.DataLabelsColumn property with the name of the property in your business object in the new data source. You can check an online demo with source included regarding this scenario.

    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 the blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top