Simple list<Decimal> binding in xaml c# please

3 posts, 0 answers
  1. Thomas
    Thomas avatar
    3 posts
    Member since:
    Sep 2015

    Posted 22 Sep 2015 Link to this post


    I need to do a binding with a simple generic list of Decimal  ( LIST<Decimal> ).

    This list<> contain de data i need to bind in my xaml UserControl in C# windows project.

    How must i proceed PLEASE ?

     When a set the ItemsSource to this list<> this doesn't work...


    THANKS for one example please


  2. Thomas
    Thomas avatar
    3 posts
    Member since:
    Sep 2015

    Posted 22 Sep 2015 in reply to Thomas Link to this post

    Or ObservableCollection<Decimal> instead of the list<Decimal>.

    Thank you for one simple example please


  3. DevCraft R3 2016 release webinar banner
  4. Martin
    Martin avatar
    1044 posts

    Posted 24 Sep 2015 Link to this post

    Hi Thomas,

    Can you please tell me what chart type you are using? If you want to display your data in a Cartesian or polar chart you should keep in mind that those types of charts visualize two dimensional data and it won't work with a collection of Double values. The chart's series will expect to get two(or more) values values from its ItemsSource's objects. One for the horizontal and another for the vertical axis. If the series is bubble series you will also have to provide a third value for the volume of the data points. You can read more about populating a chart in the Create Data-Bound Chart help article.

    On the other side the pie chart's series can display single dimensional data by just setting its ItemsSource to a collection of doubles. Here is an example:
        <telerik:PieSeries ItemsSource="{Binding}"/>

    this.DataContext = new ObservableCollection<double>() { 2, 8 };

    I hope this helps.

    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
Back to Top