DataBinding Questions

Thread is closed for posting
2 posts, 1 answers
  1. Amir
    Amir avatar
    2 posts
    Member since:
    Jan 2009

    Posted 07 Jan 2009 Link to this post


    I had a question i am creating a bar chart and and i have a Collection of keyValuepair of strings and double like so


    ICollection<KeyValuePair<stringdouble>> topCompanies = new List<KeyValuePair<stringdouble>>(); 

    now what i want to happen is for bar chart to show me the string value in KeyValuePair on xAxis and the double value on yAxies

    now the yAxies is binding fine, but xAxis is not showing the string value its showing 1.2.3....

    how can i accomplish this ?

    Also to addition to this how can i apply .NET formattings to the double values like if i want 128.01 to display as $128.01 in chart?

  2. Answer
    Ves avatar
    2926 posts

    Posted 09 Jan 2009 Link to this post

    Hi Amir,

    Please, find attached a sample page, showing this functionality. The labels formatting is discussed in more details in this help topic. Note, that you can set the ChartSeries.DefaultLabelValue property after the chart series is created i.e. after the chart is databound.

    Kind regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top