Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7836829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:20:08+00:00 2026-06-02T14:20:08+00:00

I am getting the following Exception: Input string was not in a correct format

  • 0

I am getting the following Exception:

“Input string was not in a correct format” on DataBind() line.

I believe what is happening is that the poll is being created with numbers/integers and Telerik is being clever and treating them as ints instead of as strings.

Is there a way to tell the telerik RadChart to either treat everything as strings or format things on a per entry basis.

These two people have encountered a similar problem;

http://www.telerik.com/community/forums/aspnet-ajax/chart/x-axis-values-mixed-strings-and-ints.aspx

http://www.telerik.com/community/forums/wpf/chart/error-binding-string-value-to-x-axis-using-mvvm.aspx

cs

private void PopulatePollResults(int pollID)
    {
        SqlHelper sql = new SqlHelper();
        DataSet dsResults = sql.ExecuteDataSet("ReturnPollResults", pollID);

        dsResults.Tables[0].DefaultView.Sort = "AnswerID DESC";

        trcResults.DataSource = dsResults.Tables[0].DefaultView;
        trcResults.DataBind();

        trcResults.PlotArea.Appearance.Dimensions.Margins.Top = 10;
        trcResults.PlotArea.Appearance.Dimensions.Margins.Right = 5;
        trcResults.PlotArea.Appearance.Dimensions.Margins.Bottom = 10;
        trcResults.PlotArea.Appearance.Dimensions.Margins.Left = 177;


        lblNoOfVotes.Text = dsResults.Tables[1].Rows[0]["Count"].ToString() + " vote(s)";
    }

ascx

<telerik:RadChart ID="trcResults" runat="server"
        ChartTitle-Visible="false"
        Legend-Visible="false"
        SeriesOrientation="Horizontal"
        Height="160px"
        Width="240px" >
        <Series>
            <telerik:ChartSeries DataYColumn="Votes"
                DefaultLabelValue="#%">
                <Appearance FillStyle-FillType="Solid" 
                    FillStyle-MainColor="#660066" 
                    Border-Visible="false"
                    TextAppearance-TextProperties-Font="Arial" >
                    <FillStyle FillType="Solid" MainColor="102, 0, 102">
                    </FillStyle>
                    <TextAppearance TextProperties-Font="Arial, 9pt">
                    </TextAppearance>
                    <Border Visible="False" />
                </Appearance>
            </telerik:ChartSeries>
        </Series>
        <Appearance Border-Visible="False" FillStyle-FillType="Solid" 
            FillStyle-MainColor="Transparent" Dimensions-AutoSize="false" 
            Dimensions-Width="220px" Dimensions-Height="160px" >
            <FillStyle MainColor="Transparent">
            </FillStyle>
            <Border Visible="False" />
        </Appearance>
        <PlotArea>
            <YAxis2>
                <AxisLabel>
                    <Appearance RotationAngle="0">
                    </Appearance>
                </AxisLabel>
            </YAxis2>
            <Appearance FillStyle-FillType="Solid" FillStyle-MainColor="Transparent" 
                Border-Visible="False" >
                <FillStyle FillType="Solid" MainColor="Transparent">
                </FillStyle>
                <Border Visible="False" />
            </Appearance>
            <XAxis DataLabelsColumn="AnswerText" IsZeroBased="False">
                <Appearance MajorTick-Color="#333333"
                    TextAppearance-TextProperties-Color="#333333"
                    TextAppearance-TextProperties-Font="Arial" >
                    <TextAppearance TextProperties-Color="51, 51, 51" 
                        TextProperties-Font="Arial, 8pt">
                    </TextAppearance>
                </Appearance>
                <AxisLabel>
                    <Appearance RotationAngle="270">
                    </Appearance>
                </AxisLabel>
                <Items>
                    <telerik:ChartAxisItem>
                        <TextBlock>
                            <Appearance TextProperties-Font="Arial, 8.25pt">
                            </Appearance>
                        </TextBlock>
                    </telerik:ChartAxisItem>
                    <telerik:ChartAxisItem Value="1">
                        <TextBlock>
                            <Appearance TextProperties-Font="Arial, 8.25pt">
                            </Appearance>
                        </TextBlock>
                    </telerik:ChartAxisItem>
                    <telerik:ChartAxisItem Value="2">
                        <TextBlock>
                            <Appearance TextProperties-Font="Arial, 8.25pt">
                            </Appearance>
                        </TextBlock>
                    </telerik:ChartAxisItem>
                    <telerik:ChartAxisItem Value="3">
                        <TextBlock>
                            <Appearance TextProperties-Font="Arial, 8.25pt">
                            </Appearance>
                        </TextBlock>
                    </telerik:ChartAxisItem>
                    <telerik:ChartAxisItem Value="4">
                        <TextBlock>
                            <Appearance TextProperties-Font="Arial, 8.25pt">
                            </Appearance>
                        </TextBlock>
                    </telerik:ChartAxisItem>
                    <telerik:ChartAxisItem Value="5">
                        <TextBlock>
                            <Appearance TextProperties-Font="Arial, 8.25pt">
                            </Appearance>
                        </TextBlock>
                    </telerik:ChartAxisItem>
                    <telerik:ChartAxisItem Value="6">
                        <TextBlock>
                            <Appearance TextProperties-Font="Arial, 8.25pt">
                            </Appearance>
                        </TextBlock>
                    </telerik:ChartAxisItem>
                    <telerik:ChartAxisItem Value="7">
                        <TextBlock>
                            <Appearance TextProperties-Font="Arial, 8.25pt">
                            </Appearance>
                        </TextBlock>
                    </telerik:ChartAxisItem>
                </Items>
            </XAxis>
            <YAxis>
                <Appearance Visible="false" />
                <AxisLabel>
                    <Appearance RotationAngle="0">
                    </Appearance>
                </AxisLabel>
            </YAxis>
        </PlotArea>
        <ChartTitle Visible="False">
            <Appearance Visible="False">
            </Appearance>
        </ChartTitle>
        <Legend Visible="False">
            <Appearance Visible="False">
            </Appearance>
        </Legend>
    </telerik:RadChart>

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T14:20:12+00:00Added an answer on June 2, 2026 at 2:20 pm

    http://www.telerik.com/community/forums/aspnet-ajax/chart/input-string-was-not-in-a-correct-format.aspx#2074677

    Telerik support proposed the following solution.

    …attach handlers to DataBinding and BeforeLayout events and in the first prepend a sentinel symbol to all values and in the second remove the sentinel symbol

     ...
     this.trcResults.DataBinding += this.trcResults_DataBinding;
     this.trcResults.BeforeLayout += this.trcResults_BeforeLayout;
     this.trcResults.DataSource = pcl;
     this.trcResults.DataBind();
    }
    
    void trcResults_DataBinding(object sender, EventArgs e)
    {
     var senderChart = (RadChart)sender;
     var pcl = senderChart.DataSource as IEnumerable<PollContainer>;
    
     foreach (var pollContainer in pcl)
     {
      // prepend a sentinel symbol
      pollContainer.AnswerText = "x" + pollContainer.AnswerText;
     }
    }
    
    
    void trcResults_BeforeLayout(object sender, EventArgs e)
    {
     foreach (var axisItem in this.trcResults.PlotArea.XAxis.Items)
     {
      // remove the sentinel symbol
      axisItem.TextBlock.Text = axisItem.TextBlock.Text.Remove(0, 1);
     }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No matter what i attempt i keep getting the following exception being thrown by
I am getting following Exception on Android 2.2.1: java.lang.NoSuchMethodError: java.lang.String.isEmpty I am calling text.isEmpty
I am getting the following error when I get to the line that invokes
I am getting Following Exception while configuring the Connection Pool in Tomcat This is
I have created mock: GuiExHandler mockGuiEx = EasyMock.createMock(MockedClass.class); And Im getting following exception: Testcase:
I'm getting the following exception when I run my application in Release mode from
I am getting the following exception when i try to use the fetchall method
I am getting the following exception: Nullable object must have a value Everything was
I'm getting the following exception when executing the first preparedstatement after a period of
I am getting he following Exception while running my Quartz Schdular program. Below is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.