Binding produces error: The type of column with name EstKBytesSaved is not numeric

11 posts, 0 answers
  1. ewart
    ewart avatar
    221 posts
    Member since:
    Jan 2007

    Posted 29 Jan 2009 Link to this post

    Hi.  When I bind my chart I get the error Binding produces error: The type of column with name  EstKBytesSaved is not numeric 

       // Display series           
       rcChart.DataSource = lstStats;  
       rcChart.Series[0].DataYColumn = "EstKBytesSaved";  
       rcChart.Series[1].DataYColumn = "Hits";  
       rcChart.PlotArea.XAxis.DataLabelsColumn = sDataLabelColumn;  
       rcChart.DataBind(); 

    Where lstStats is a generic <List> of items and both EstKBytesSaved and Hits are declared as long values.  e.g.
     
        public long EstKBytesSaved   
          {  
             get { return _lEstKBytesSaved ; }  
          } 

    in this scenario, the graph does not produce at all

    This error was, and can only be found in production - which makes it really confusing - if I compile the project in RELEASE mode and run the executable, the error appears.  If I compile it in DEBUG mode there are no errors and the graph produces just fine!  I have a few #if DEBUG statements in the solution, but none of my #DEBUG seem to relate to the charting areas.  I wonder what the microsoft compiler is doing here..?

    given EstKBytesSaved  is declared as a long.   I wondered if numeric in this instance meant it had to be a numeric in the database sense, e.g.  double in c#. but the telerik examples use int, so I figured any numeric value would be ok.

    if I change my internal values to convert my long to an int, when compiling in RELEASE mode:

      public int EstKBytesSaved  
          {  
             get { return (int)((long)_lEstBytesSaved / 1024); }  
          } 

    In this scenario, the graph produces but incorrectly with a message about "no or empty series" (If i loop through and message output the data there are most definetly values.. values which graph correctly in debug mode)

    If I change my internal values to convert to a double, when compiling in RELEASE mode, e.g.

     public double EstKBytesSaved  
          {  
             get { return (double)((long)_lEstBytesSaved / 1024); }  
          } 

    I get the same "there is no or empty series" error message.

    I'm stumped, any ideas where to look next?

    Regards
      Ewart.

  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 02 Feb 2009 Link to this post

    Hi Ewart,

    We tried to reproduce this behavior in a small project, but to no avail. The build configuration did not seem to affect the chart output and it displayed the correct results in both build configurations. Please, find attached this sample project, showing RadChart bound in a similar scenario. I have removed the binaries, so you will need to add  Telerik.WinControls.RadChart.  Give it a try and let us know if you can reproduce the issue with it.

    Greetings,
    Ves
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Zeya Bakhtyar
    Zeya Bakhtyar avatar
    3 posts
    Member since:
    Jan 2010

    Posted 05 Aug 2010 Link to this post

    I am seeing same error with Chart in the report. Column is double type but error says column is not numeric type.
  5. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 10 Aug 2010 Link to this post

    Hello Zeya Bakhtyar,

    I am afraid Ewart did not send us back any additional details, so we are still not aware of the possible reason for this issue. Please, open a formal support ticket and send us a small runnable project, that reproduces the issue, so that we can investigate it. Thank you.

    Best regards,
    Ves
    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
  6. Benedict
    Benedict avatar
    16 posts
    Member since:
    Jun 2009

    Posted 12 Sep 2010 Link to this post

    I am facing the same problem.

      radChartRunningRSSI.Series.Clear();
                radChartRunningRSSI.Series.Add(new ChartSeries("RSSIX", ChartSeriesType.Spline) { DataYColumn = "RssiX", DataXColumn = "Timestamp", YAxisType = ChartYAxisType.Primary });
                radChartRunningRSSI.Series.Add(new ChartSeries("RSSIY", ChartSeriesType.Spline) { DataYColumn = "RssiY", DataXColumn = "Timestamp", YAxisType = ChartYAxisType.Primary });
                radChartRunningRSSI.Series.Add(new ChartSeries("RSSIZ", ChartSeriesType.Spline) { DataYColumn = "RssiZ", DataXColumn = "Timestamp", YAxisType = ChartYAxisType.Primary });
                radChartRunningRSSI.PlotArea.XAxis.DataLabelsColumn = "LabelX";


    Later I am databinding

     radChartRunningRSSI.DataSource = t.TagInfos.ToArray();
     radChartRunningRSSI.DataBind();

    t.TagInfos is a List of <TagInfo> with Properties RssiX, RssiY etc.

    interestingly there is a different error produced, if I do not convert the list to an array.

    With the array conversion I get a "The type of column with name  RssiX is not numeric" exception ...


    odd thing.

  7. Benedict
    Benedict avatar
    16 posts
    Member since:
    Jun 2009

    Posted 12 Sep 2010 Link to this post

    By the way, did you run your provided source code ? It is simple wrong ....

    ser = new ChartSeries("Series3");
    ser.DataYColumn = "MyProperty3";
    radChart1.Series.Add(ser);


    But the third property is called
    public int MyPropertyInt { get; set; }

    What sort of support quality is it here ?

  8. Benedict
    Benedict avatar
    16 posts
    Member since:
    Jun 2009

    Posted 12 Sep 2010 Link to this post

    If I add the List directly as a DataSource:

    I get
       bei Telerik.Charting.Chart.GetException(RenderEngine renderEngine, Exception ex)
       bei Telerik.Charting.Chart.GetImage(Int32 width, Int32 height)
       bei Telerik.Charting.Chart.GetImage()
       bei Telerik.WinControls.UI.RadChart.GetImage()
       bei Telerik.WinControls.UI.RadChart.OnPaint(PaintEventArgs e)
       bei System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
       bei System.Windows.Forms.Control.WmPaint(Message& m)
       bei System.Windows.Forms.Control.WndProc(Message& m)
       bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
       bei System.Windows.Forms.UserControl.WndProc(Message& m)
       bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
  9. Benedict
    Benedict avatar
    16 posts
    Member since:
    Jun 2009

    Posted 12 Sep 2010 Link to this post

    I invested further time and used your program which loads the datasource within the Form_Load event ...
    with this it works with my datastructures too

    But if I do the following

      private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
            {
            
                var t = comboBox1.SelectedItem as Tag;
                radChart1.DataSource = t.TagInfos;
                radChart1.DataBind();
            
            }


    I am getting the exception ... what is the difference here  ???
    The thread context is the same, everything is working in the gui thread.

    The only difference is that the  chart is not drawn yet ...
    so what is the right way to refresh the chart with bounded data ?
  10. Benedict
    Benedict avatar
    16 posts
    Member since:
    Jun 2009

    Posted 12 Sep 2010 Link to this post

    Ok, I solved it with doing a "dummy" databinding in the Load Event, then subsequent bindings to work.

    Very odd behaviour.

  11. Sonal Patel
    Sonal Patel avatar
    4 posts
    Member since:
    Aug 2009

    Posted 06 Dec 2010 Link to this post

    I'm having the same issue.  Can you please post a code sample of how you got this to work.  Thanks.
  12. Rishi
    Rishi avatar
    11 posts
    Member since:
    Mar 2012

    Posted 04 Apr 2012 Link to this post

    I had these kind of problem Just few mints ago, then I see this thread to find out whats happening.

    In my scenario. I got an ChartException: The type of column with name CreatedDate is not numeric.    
    CreatedTime Format is like  "April2012"

    Trouble shooted Steps.
    1. For this problem I changed the Createdtime Datatype into varchar from SQL side.
    2.From the vb.net side, I found that. I've been binding the for couple of times radchartcontrol in different methods.
       Then I realzed that to clear the chart controle, before binding the data.

    Then I used as

    radchart.clear()
    radchart.datasourece = ds
    radchart.databind()

    After using it, Am not seeing any issue!
    Hope, it will help you out.

    Thanks,
    Rishi
Back to Top
UI for WinForms is Visual Studio 2017 Ready