Hi Haneef .
Thanks for your reply.
I guess by now you already understand what I want to do (according to your first example).
I have data that I would like to put into a chart and a grid at the same time and have some sorting capabilities on the grid.
Option 1 :
Use the virtual grid and implement a layer that will connect the query in the grid with the data in the chart series. This is nice and quick but then I’ll have to do heavy lifting to get the sorting feature (sort each time according to another X point in the chart).
Options 2 :
Use a simple grid. I still don’t know how to get the sorting to work (I hope sorting along a column is simple) , but I have to manually put each point in the table because I can’t
“load” a series of points to the grid at once. This looks like a waste of time (let’s say I can live with the memory for hold two copies of the data).
I’m looking for something like this (see attached project) :
double [] x = new double[] {10 , 20 , 30 , 40 , 50} ;
double [] y = new double[] {23 , 43 , 78 , 49 , 21} ;
// insert the data to the chart
ChartSeries cs = this.chartControl1.Model.NewSeries() ;
for(int i = 0 ; i < y.Length ; i++)
cs.Points.Add(x[i] , y[i]) ;
this.chartControl1.Series.Add(cs) ;
// insert the data to the table
this.gridControl1.Model.PopulateValues(
GridRangeInfo.Cells(1 , 1 , 1 , 5) , cs.SeriesModel) ;
What can I “put” instead of cs.SeriesModel at the last line to make this work ?
Any other options ? Ideas ?
Is there a way to get an array from the series that can be loaded into the grid ?
(I post this in both the chart and grid forums)
Thanks
Amit
WindowsApplication440.zip