I have a datatable that I am using to populate a pie chart. It has two columns Fund and Amount. I want the labels to populate with the Fund name AND the #%...i.e. "American Funds 10%"
The problem I am having is retrieving the Fund name from the data row. My chart uses a table adapter as the datasource.
I keep getting "Object reference not set to an instance of an object" error. The above code works perfectly if I substitute row["fund"] for just a normal string. How can I capture the actual row value?
Rich
The problem I am having is retrieving the Fund name from the data row. My chart uses a table adapter as the datasource.
private void chart1_NeedDataSource(object sender, EventArgs e) |
{ |
Telerik.Reporting.Processing.Chart chart = sender as Telerik.Reporting.Processing.Chart; |
chart.DataSource = this.richPlayDBDataSetTableAdapter1.GetData(Convert.ToString(chart.Report.Parameters["SSN"])); |
DataRowView row = (DataRowView)chart.DataItem; |
Telerik.Reporting.Chart defChart = (Telerik.Reporting.Chart)chart.ItemDefinition; |
defChart.Series[0].DefaultLabelValue = string.Format("{0} #%", row["Fund"]); |
} |
I keep getting "Object reference not set to an instance of an object" error. The above code works perfectly if I substitute row["fund"] for just a normal string. How can I capture the actual row value?
Rich