RadHtml Chart Column Name having special character like '.(dot)' While binding its throwing error

2 posts, 0 answers
  1. Chary
    Chary avatar
    13 posts
    Member since:
    Apr 2014

    Posted 24 Apr 2014 Link to this post


    I am trying to Bind RadhtmlChart my column name contains '.' when this appears in the column it is throwing error,how can I handle this.


            dt.Columns.Add("data..."); // This contains '.' at end of column 
            DataRow dr = dt.NewRow();       
            dr[0] = "2011-12";
            dr[1] = "500";
            ColumnSeries cs = new ColumnSeries();
            cs.LabelsAppearance.Visible = false;
            cs.Name = dt.Columns[1].ToString();
            cs.DataFieldY = dt.Columns[1].ToString();
            radChart.PlotArea.XAxis.DataLabelsField = dt.Columns[0].ToString();
            radChart.PlotArea.YAxis.MinValue = 0;
            cs.LabelsAppearance.ClientTemplate = "#= category #";
            cs.TooltipsAppearance.DataFormatString = "{0:N0}";
            cs.TooltipsAppearance.ClientTemplate = "#= category #: #= value #";
            radChart.PlotArea.XAxis.Type = Telerik.Web.UI.HtmlChart.AxisType.Category;
            radChart.PlotArea.XAxis.LabelsAppearance.DataFormatString = "yyyy-MM";
            radChart.PlotArea.XAxis.LabelsAppearance.Visible = true;
            radChart.DataSource = dt;
  2. Stamo Gochev
    Stamo Gochev avatar
    208 posts

    Posted 29 Apr 2014 Link to this post

    Hi Chary,

    Using special characters (like ".", "\", etc) is not supported when databinding a RadHtmlChart. The reason for this is that the corresponding javascript datasource is created in a custom way before it is sent to the client side.

    What I can suggest you in this case is to use a column name without special characters. If you are getting some data from a SELECT statement of your database, you can set an alias for the column name, which does not contain a dot.

    Stamo Gochev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top