[CLOSED] Error Creating control - chart modelfield

  1. #1

    [CLOSED] Error Creating control - chart modelfield

    I've got a simple chart bound to a store which gets its data from stored procedure. This part works fine. Error shows in design view ' Error Creating Control - Panel1' --- compiled and running project shows no error on webpage.

    Cannot create an object type of 'system.string[]' from its string representation 'PROJNUM' for the 'Field' property. -- PROJNUM field is a varchar field in db.

    Using ext.net, ext.net.utilities & Newtonsoft.json 6.0.3 (however, VS shows Newtonsoft.json with a version of in project properties references window -- it is pointing to the correct dll though).

    <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="facCharts.ascx.vb" Inherits="MSEFUSION.facCharts" %>
    <%@ Import Namespace="System" %>
    <%@ Import Namespace="System.Data.SqlClient" %>
    <%@ Import Namespace="System.Data" %>
    <%@ Import Namespace="System.Data.OleDb" %>
    <ext:Panel ID="Panel1" runat="server" Height="300" Title="Title">
    <ext:Chart ID="Chart1"  runat="server" Animate="true" Width="330" Height="300" Shadow="true" InsetPadding="30" Theme="Base:gradients">
        <LegendConfig Position="Right" />  
            <asp:SqlDataSource ID="SQLDS1" runat="server"   ConnectionString="<%$ ConnectionStrings:MSE_FIN %>" SelectCommand="PROC_LIST_PRJ_LARGEBUD_BYPI" SelectCommandType="StoredProcedure">
                    <asp:Parameter Name="PID"  Type="Int32" DefaultValue="1016" />
            <ext:Store ID="Store1" runat="server" DataSourceID="SQLDS1" AutoDataBind="True"  >
                    <ext:Model ID="Model1" runat="server" >
                            <ext:ModelField Name="PROJNUM" />
                            <ext:ModelField Name="DBAL" />
            <ext:PieSeries AngleField="DBAL" ShowInLegend="false" Donut="0" Highlight="true" HighlightSegmentMargin="20">
                <Label Display="Rotate" Contrast="true" Font="12px Arial" Field="PROJNUM" />
    Last edited by Daniil; Jun 24, 2014 at 2:13 PM. Reason: [CLOSED]
  2. #2
    Hi @megatechboy,

    I removed the SqlDataSource and added this instead:
    protected void Page_Load(object sender, EventArgs e)
        if (!X.IsAjaxRequest)
            this.Store1.DataSource = new object[]
                    PROJNUM = "PROJNUM 1",
                    DBAL  = 100
    and your control runs well for me. No error and the Chart appears.

    Please post a screenshot of the Exception.

    Ideally, please provide a runnable test case to reproduce. No depends on a database, please. It should not require it.
  3. #3
    Thanks Daniil, attached is a screenshot. I tried it with your changes, and it run, a chart was displayed, but the error is still there, in the design view of VS editor.

    I think it might be a problem with VS and the versions of references i have installed.
    Attached Thumbnails Click image for larger version. 

Name:	screenshot1.png 
Views:	20 
Size:	64.4 KB 
ID:	12861  
  4. #4
    Here is a quote from
    Quote Originally Posted by geoffrey.mcgill View Post
    Currently Ext.NET provides only limited Visual Studion Design Time support.
    I am afraid it is still actual.

Similar Threads

  1. [CLOSED] Error creating custom control for date picker.
    By speedstepmem4 in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 18, 2013, 8:18 AM
  2. [CLOSED] Getting ExtJs error on creating bar chart.
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 30, 2013, 12:56 PM
  3. Replies: 11
    Last Post: Mar 08, 2012, 2:27 AM
  4. [CLOSED] Error creating control
    By flaviodamaia in forum 1.x Help
    Replies: 5
    Last Post: Mar 20, 2009, 8:32 AM
    By magoo in forum Bugs
    Replies: 0
    Last Post: Mar 20, 2009, 8:14 AM

Posting Permissions