How many data series I have in a RadChart ?

3 posts, 1 answers
  1. MahMah
    MahMah avatar
    18 posts
    Member since:
    Dec 2011

    Posted 09 Jan 2012 Link to this post

    Hi,

    I want to disable some buttons when I have more that one dataseries in the chart. So I have chosen DataBound event of chart. But I can not access to number of dataseries which was loaded into grid at that moment. I have seen number of data series in some private properties of chart by using Quick Watch window but I can not see in public ones (number of data series).

    Thanks in advance.
  2. Answer
    Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 12 Jan 2012 Link to this post

    Hi,

    void radChart_DataBound(object sender, Telerik.Windows.Controls.Charting.ChartDataBoundEventArgs e)
    {
       var count = this.radChart.SeriesMappings.Count; //((Telerik.Windows.Controls.RadChart)(sender)).SeriesMappings.Count
    }

    I think this is what you are looking for.

    Note that if the count is 0 than you must be using the default series definition.

    Regards,
    Petar Marchev
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. MahMah
    MahMah avatar
    18 posts
    Member since:
    Dec 2011

    Posted 12 Jan 2012 Link to this post

    Hi Petar,

    Thank you for your support.

    You are correct and the problem was that I expected to see all data mappings in the first DataBound occurrence but it was called as much as the number of series and I should had been patient to see the other series at the further DataBound calls.

    Regards.
Back to Top