Can't bind RangeBar

3 posts, 0 answers
  1. Andy
    Andy avatar
    25 posts
    Member since:
    Aug 2011

    Posted 13 Dec 2015 Link to this post

    Not sure what I'm doing wrong.  I cannot databind a RangeBarSeries.

     In the below test I took the Demo binding example and added a RangeBarSeries.  The Area and Line series show fine but the RangeBar does not show. ( See Attached)

    Here is the code:

    protected void Page_Load(object sender, EventArgs e)
           string[] tempTitles = { "In the Heart of the Sea", "The Hunger Games: Mockingjay - Part 2", "Krampus", "The Good Dinosaur", "Creed", "Spectre", "The Night Before", "The Peanuts Movie", "Spotlight", "Brooklyn" };
           foreach (string one in tempTitles)
           List<MarketShareData> chromeData = new List<MarketShareData>();
           chromeData.Add(new MarketShareData(10.8, 23.8));
           chromeData.Add(new MarketShareData(11.6, 24.1));
           chromeData.Add(new MarketShareData(12.3, 25.0));
           chromeData.Add(new MarketShareData(13.6, 25.6));
           chromeData.Add(new MarketShareData(14.5, 25.9));
           chromeData.Add(new MarketShareData(15.9, 27.9));
           chromeData.Add(new MarketShareData(16.7, 29.4));
           chromeData.Add(new MarketShareData(17.0, 30.3));
           chromeData.Add(new MarketShareData(17.3, 30.5));
           chromeData.Add(new MarketShareData(19.2, 32.3));
           chromeData.Add(new MarketShareData(20.5, 33.4));
           chromeData.Add(new MarketShareData(22.4, 34.6));
           RangeBarChart.DataSource = chromeData;
          public class MarketShareData
             public MarketShareData(double marketShare2010, double marketShare2011)
                _marketShare2010 = marketShare2010;
                _marketShare2011 = marketShare2011;
             private double _marketShare2010;
             public double MarketShare2010
                get { return _marketShare2010; }
                set { _marketShare2010 = value; }
             private double _marketShare2011;
             public double MarketShare2011
                get { return _marketShare2011; }
                set { _marketShare2011 = value; }

    <telerik:RadHtmlChart runat="server" ID="RangeBarChart" Width="800" Height="600">
                <ChartTitle Text="All Predictions">
                    <Appearance Align="Center" Position="Top"></Appearance>
                    <Appearance Position="Bottom"></Appearance>
                    <YAxis >
                        <LabelsAppearance DataFormatString="${0}M"></LabelsAppearance>
                        <MinorGridLines Visible="false" />
                            <telerik:RangeBarSeries Name="Prediction" DataFromField="MarketShare2010" DataToField="marketShare2011"  >
                            <telerik:AreaSeries Name="Market share in 2010" DataFieldY="MarketShare2010">
                            <telerik:LineSeries Name="Market share in 2011" DataFieldY="MarketShare2011">




  2. Marin Bratanov
    Marin Bratanov avatar
    3558 posts

    Posted 15 Dec 2015 Link to this post

    Hi Andy,

    You need to make sure the data fields match the actual field names in the data source as they are case sensitive:

    <telerik:RangeBarSeries Name="Prediction" DataFromField="MarketShare2010" DataToField="MarketShare2011">


    Marin Bratanov
    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 Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
  4. Andy
    Andy avatar
    25 posts
    Member since:
    Aug 2011

    Posted 15 Dec 2015 in reply to Marin Bratanov Link to this post

    Thanks... that was a stupid mistake on my part... especially since I had the correct ones right below
Back to Top