This is a migrated thread and some comments may be shown as answers.

RadChart and Grid integration in different RadTabs

2 Answers 62 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Hrushikesh
Top achievements
Rank 1
Hrushikesh asked on 21 Jun 2012, 06:31 PM
Hi,

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,
Hrushi

2 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 25 Jun 2012, 04:10 PM
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!
Lancelot
0
Bartholomeo Rocca
Top achievements
Rank 1
answered on 26 Jun 2012, 07:38 AM
Hello Hrushikesh,

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


Greetings,
Bart.
Tags
Chart
Asked by
Hrushikesh
Top achievements
Rank 1
Answers by
Lancelot
Top achievements
Rank 1
Bartholomeo Rocca
Top achievements
Rank 1
Share this question
or