RadChart and Grid integration in different RadTabs

3 posts, 0 answers
  1. Hrushikesh
    Hrushikesh avatar
    1 posts
    Member since:
    Jun 2012

    Posted 21 Jun 2012 Link to this post


    I want to display a data table in grid view and plot the same in RadChart. Every column in grid will be displayed as a LineSeries in RadChart against a common timestamp on X axis. There can be n number of columns in Grid depending upon data in SQL database. As of now I dont want to work with SQL data, so I can create some data and fill up the grid and chart. I dont want to hardcode the number of columns in grid. I would like to show the gridview and RadChart in different Rad tabs. I want this using MVVM pattern. 

    Can anyone tell me how to do this? I am totally new to XAML binding and MVVM.

    I am using Silverlight controls, C# in Visual Studio 2010 environment.

    Thank you,
  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 25 Jun 2012 Link to this post

    Hi Hrushikesh,

    One of the amazing things about RadGridView is it's ability to be flexible against different data sources. You can absolutely define your columns depending on your data source. This link will bring you to the documentation on how to do just that.

    You are on the right path by binding the column definitions to a ViewModel first, and the populating the ViewModel with data from the database. Your scenario is a common one and you'll be moving your application forward technologically by doing this.

    When you click on the link and go to the documentation, it shows the two main ways to set your columns. Either explicitly in your code (hard-coding it in) or via the ViewModel. The first example on the page explains how to do it automatically. Before you close the documentation, be sure to look in the left pane, there is a ton of help and documentation for RadGridView. This is a great resource for you.

    Good Luck!
  3. Bartholomeo Rocca
    Bartholomeo Rocca avatar
    247 posts
    Member since:
    May 2006

    Posted 26 Jun 2012 Link to this post

    Hello Hrushikesh,

    I would suggest you to review the RadChart databinding topics here to get you started.

Back to Top