Hi,
Based in the intergration sample I am trying to populate a chart from a grid. I have the following functions which I took from your sample. I have changed the function to use all records not just the selected ones.
When I execure the following line:
I get the following error:
Unable to cast object of type 'CoachTech.Test_VO2' to type 'System.Data.DataRow'.
Any Idea what I am doing wrong?
Cheers,
Kevin.
Based in the intergration sample I am trying to populate a chart from a grid. I have the following functions which I took from your sample. I have changed the function to use all records not just the selected ones.
| private void ShowSelectedRecordsInChart() |
| { |
| DataTable table = new DataTable(); |
| DataColumn col = new DataColumn("Shuttle", typeof(double)); |
| table.Columns.Add(col); |
| try |
| { |
| foreach (DataRecord item in this.datagrdV02.Records) |
| { |
| DataRow row = table.NewRow(); |
| row["Shuttle"] = ((DataRow)item.Data)["Shuttle"]; |
| table.Rows.Add(row); |
| } |
| } |
| catch (Exception ex) |
| { |
| MessageBox.Show(ex.Message); |
| } |
| } |
When I execure the following line:
row[
"Shuttle"] = ((DataRow)item.Data)["Shuttle"];
I get the following error:
Unable to cast object of type 'CoachTech.Test_VO2' to type 'System.Data.DataRow'.
Any Idea what I am doing wrong?
Cheers,
Kevin.
