radGridViewSaleReport.DataSource = myList; //binding listHtmlViewDefinition view = new HtmlViewDefinition();view.RowTemplate.Rows.Add(new RowDefinition());view.RowTemplate.Rows.Add(new RowDefinition());view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Customer Name"));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Unit"));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Unit Type"));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Unit Area"));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Price/Sq.M."));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Selling Price"));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Initial booking"));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Booking"));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Signing Contract"));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Contract signed"));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Transfer"));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Sale"));view.RowTemplate.Rows[0].Cells.Add(new CellDefinition("Comment"));view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Amount"));view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Date"));view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Amount"));view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Date"));view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Amount"));view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Date"));view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Amount"));view.RowTemplate.Rows[1].Cells.Add(new CellDefinition("Date"));view.RowTemplate.Rows[0].Cells[0].RowSpan = 2;view.RowTemplate.Rows[0].Cells[1].RowSpan = 2;view.RowTemplate.Rows[0].Cells[2].RowSpan = 2;view.RowTemplate.Rows[0].Cells[3].RowSpan = 2;view.RowTemplate.Rows[0].Cells[4].RowSpan = 2;view.RowTemplate.Rows[0].Cells[5].RowSpan = 2;view.RowTemplate.Rows[0].Cells[9].RowSpan = 2;view.RowTemplate.Rows[0].Cells[11].RowSpan = 2;view.RowTemplate.Rows[0].Cells[12].RowSpan = 2;view.RowTemplate.Rows[0].Cells[6].ColSpan = 2;view.RowTemplate.Rows[0].Cells[7].ColSpan = 2;view.RowTemplate.Rows[0].Cells[8].ColSpan = 2;view.RowTemplate.Rows[0].Cells[10].ColSpan = 2;radGridViewSaleReport.Update();this.radGridViewSaleReport.ViewDefinition = view;this.radGridViewSaleReport.TableElement.CellSpacing = -1;this.radGridViewSaleReport.TableElement.RowSpacing = -1;radGrid.Rows[1].Cells[1].Style.BackColor = System.Drawing.Color.Red;
radGrid.Rows[1].Cells[1].Style.ForeColor = System.Drawing.Color.Red;I have a chart that shows percent. I would like the Y axis to show 0 through 100 if the maximum value in the series is less than 100. If the maximum value is greater than 100 then I would like the chart to automaticaly scale the Y axis.
I thought that I could use Telerik.Charting.ChartSeriesCollection.GetMaxYValue() method, however it is not working as I expect. The value it returns is Infinity, not the maximum value. This is how I am trying to achomplish.
if(chart.Series.GetMaxYValue() <= 100){ chart.PlotArea.YAxis.MaxValue = 100; chart.PlotArea.YAxis.Appearance.TextAppearance.TextProperties.Color = Color.Black;}else { chart.PlotArea.YAxis.AutoScale = true; chart.PlotArea.YAxis.Appearance.TextAppearance.TextProperties.Color = Color.Red;}However when the maximum value is less than 100, I never get inside the IF startment, it always bounces to the ELSE.
To diagnose, I put the following line of code in so I can se the value returned by GetMaxYValue().
var x = chart.Series.GetMaxYValue();Inside the debugger I can see the value of x is Infinity.
Any thoughts on what I'm doing wrong? Is there a better way to achomplish this?
Thanks,
Chris
