x axis values mixed strings and ints

Thread is closed for posting
8 posts, 0 answers
  1. debett
    debett avatar
    30 posts
    Member since:
    Feb 2007

    Posted 07 Apr 2011 Link to this post

    Hi all,

    I have found out that when my data for x axis has mixed string and int values (even though they come in as "strings'" from the DB), I get an exception "Input string was not in a correct format." Looking at the call stack I see that it fails converting ToDouble.

    Do you know any workarounds?

    Note, this is a generic/dynamic solution, so I don't know what kind of data comes in. I allow users to select fields on the fly which they want to display on the chart. Then, I have code to populate the grid:

    qbChart.Series.Clear();
    t
    his.qbChart.DataGroupColumn = this.ddlGroup.SelectedValue;
    this.qbChart.PlotArea.XAxis.DataLabelsColumn = this.ddlX.SelectedValue;
    sdsResults.ConnectionString = cm.css.ConnectionString;
    sdsResults.SelectCommand = SQLString;             
    this.qbChart.DataBind();

    I would like to stick with sql datasource. IAlso, I do not have an option to convert values to int in DB.

    Thank you.
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 08 Apr 2011 Link to this post

    Hello debett,

    Could you elaborate a bit more on your specific scenario? We tried to reproduce the problem based on your guidelines but our efforts were unsuccessful so far -- could you review the attached sample application and let us know whether we are missing some key component that would trigger the erroneous behavior?

    Looking forward to your reply.


    Regards,
    Giuseppe
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. debett
    debett avatar
    30 posts
    Member since:
    Feb 2007

    Posted 08 Apr 2011 Link to this post

    Giuseppe,

    I have changed the data in your example and it fails:) I cannot attach here the complete project, but I'll list 2 files:

    Code:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this.RadChart1.Series.Clear();
            this.RadChart1.DataGroupColumn = "Item2";
            this.RadChart1.PlotArea.XAxis.DataLabelsColumn = "Item1";
            this.RadChart1.DataSource = this.Data;
            this.RadChart1.DataManager.ValuesYColumns = new string[] { "Item3" };
            this.RadChart1.DataBind();
             
        }
    }
     
     
    public List<Tuple<string,string, string >> Data
    {
        get
        {
            return new List<Tuple<string, string, string>>()
                       {new Tuple<string, string, string>(null, null, "1"),
                           new Tuple<string, string, string>(null, "F", "26"),
                           new Tuple<string, string, string>(null, "M", "48"),
     
                           new Tuple<string, string, string>("01", "F", "27"),
                           new Tuple<string, string, string>("01", "M", "21"),
                           new Tuple<string, string, string>("02", "F", "19"),
                           new Tuple<string, string, string>("02", "M", "23"),
     
                           new Tuple<string, string, string>("K", "F", "35"),
                           new Tuple<string, string, string>("K", "M", "29"),
                       };
        }
    }


    Behind:

    <telerik:RadChart ID="RadChart1" runat="server">
            </telerik:RadChart>

    Please, let me know if you need more info.


    Thank you.
  5. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 13 Apr 2011 Link to this post

    Hello debett,

    Our system indicates, that you have opened an identical ticket on the same issue. To avoid duplicate posts, we can continue our communication in the support ticket in question, which will be addressed shortly.

    Kind regards,
    Yavor
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Boris
    Boris avatar
    3 posts
    Member since:
    Sep 2010

    Posted 26 Sep 2011 Link to this post

    HI,
    I have the same problem i need to set to x-axis mixed types (int and string) and i get an error :
    "Input string was not in a correct format"
    Did find solution for debett and mine problem?

  7. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 28 Sep 2011 Link to this post

    Hello Boris,

    Are you applying any format strings to the values? Also, are all the values along the xAxis properly populated? Any additional information on your precise setup will help us better address the question set forth.

    All the best,
    Yavor
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  8. Boris
    Boris avatar
    3 posts
    Member since:
    Sep 2010

    Posted 28 Sep 2011 Link to this post

    Hello Yavor,
    I'm not applying any format strings to the values.
    And all the values populated.
    I use x axis to show user info, an ID of the user (304411111 - int or string)  or a name of the user (Boris - string).
    Depending on user role he can see for some users their name and for other only their ID .
    If I set only the ID to all users or only names this works fine, but when I mixed and show some users an ID and some Names
    It give me an error "Input string was not in a correct format"

    Thank's!
  9. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 03 Oct 2011 Link to this post

    Hi Boris,

    Based on the supplied information, it is hard to determine what is causing the exception.
    If the problem persists, it will be best if you open a formal support ticket, and send us a small working project, demonstrating your setup, and showing the unwanted exception, for additional review and testing.

    Best wishes,
    Yavor
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017