Error creating control - RadChart1 - cannot create object

Thread is closed for posting
6 posts, 0 answers
  1. jmann
    jmann avatar
    13 posts
    Member since:
    Oct 2006

    Posted 03 Jun 2008 Link to this post

    I am just starting to learn about Telerik about RadChart controls.

    So far I have created two .NET web projects and both times although the control has been running ok while I am in the project, when I closed and re-open the project I get the error:

    Cannot create an object of type 'Telerik.Charting.Styles.ChartMargins' from its string representation '4%, 10px, 7%' for the 'Margins' property.

    I can't be 100% sure this is the exact wording from the first error as I thought it was a one-off and didn't capture it, but this is what I am getting this time.

    All I do is drop a control on the page and change some of its properties to understand how they work. I will enclose the full source below.

    John

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TelerikExample1._Default" %>

    <%@ Register assembly="RadChart.Net2" namespace="Telerik.WebControls" tagprefix="rad" %>
    <%@ Register assembly="RadChart.Net2" namespace="Telerik.Charting" tagprefix="rad" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
       
            <rad:RadChart ID="RadChart1" runat="server" DefaultType="Pie"
                SeriesOrientation="Horizontal">
    <ChartTitle>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="4%, 10px, 14px, 7%" Dimensions-Paddings="3px, 5px, 3px, 5px"></Appearance>

    <TextBlock>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></Appearance>
    </TextBlock>

    <Marker>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px"></Appearance>
    </Marker>
    </ChartTitle>
    <Series>
    <rad:ChartSeries Type="Pie" Name="Stuff" YAxisType="Primary">
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3">
    <LabelAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></LabelAppearance>

    <PointMark Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"></PointMark>

    <TextAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></TextAppearance>

    <EmptyValue Mode="Approximation">
    <PointMark Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px"></PointMark>
    </EmptyValue>
    </Appearance>
        <Items>
            <rad:ChartSeriesItem Name="RedName" YValue="10">
                <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3">
                </Appearance>
                <Label>
                    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
                        Dimensions-Margins="1px, 1px, 1px, 1px"
                        Dimensions-Paddings="1px, 1px, 1px, 1px">
                    </Appearance>
                    <TextBlock Text="RedLabel">
                        <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
                            Dimensions-Margins="1px, 1px, 1px, 1px"
                            Dimensions-Paddings="1px, 1px, 1px, 1px">
                        </Appearance>
                    </TextBlock>
                    <Marker>
                        <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
                            Dimensions-Margins="1px, 1px, 1px, 1px">
                        </Appearance>
                    </Marker>
                </Label>
                <PointAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3">
                </PointAppearance>
            </rad:ChartSeriesItem>
            <rad:ChartSeriesItem Name="GreenName" YValue="50">
                <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3">
                </Appearance>
                <Label>
                    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
                        Dimensions-Margins="1px, 1px, 1px, 1px"
                        Dimensions-Paddings="1px, 1px, 1px, 1px">
                    </Appearance>
                    <TextBlock Text="GreenLabel">
                        <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
                            Dimensions-Margins="1px, 1px, 1px, 1px"
                            Dimensions-Paddings="1px, 1px, 1px, 1px">
                        </Appearance>
                    </TextBlock>
                    <Marker>
                        <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
                            Dimensions-Margins="1px, 1px, 1px, 1px">
                        </Appearance>
                    </Marker>
                </Label>
                <PointAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3">
                </PointAppearance>
            </rad:ChartSeriesItem>
            <rad:ChartSeriesItem Name="Yellow" YValue="40">
                <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3">
                </Appearance>
                <Label>
                    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
                        Dimensions-Margins="1px, 1px, 1px, 1px"
                        Dimensions-Paddings="1px, 1px, 1px, 1px">
                    </Appearance>
                    <TextBlock Text="Yellow">
                        <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
                            Dimensions-Margins="1px, 1px, 1px, 1px"
                            Dimensions-Paddings="1px, 1px, 1px, 1px">
                        </Appearance>
                    </TextBlock>
                    <Marker>
                        <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
                            Dimensions-Margins="1px, 1px, 1px, 1px">
                        </Appearance>
                    </Marker>
                </Label>
                <PointAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3">
                </PointAppearance>
            </rad:ChartSeriesItem>
        </Items>
    </rad:ChartSeries>
    </Series>

    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></Appearance>

    <PlotArea SeriesOrientation="Horizontal">
    <DataTable>
    <Appearance RenderType="PlotAreaRelative" TextVerticalAlign="Middle" TextHorizontalAlign="Center" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></Appearance>
    </DataTable>

    <EmptySeriesMessage>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></Appearance>

    <TextBlock>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></Appearance>
    </TextBlock>

    <Marker>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px"></Appearance>
    </Marker>
    </EmptySeriesMessage>

    <XAxis LayoutMode="Between" VisibleValues="All">
    <Appearance>
    <LabelAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></LabelAppearance>

    <TextAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></TextAppearance>
    </Appearance>

    <AxisLabel>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
            Dimensions-Margins="1px, 1px, 1px, 1px"
            Dimensions-Paddings="1px, 1px, 1px, 1px" RotationAngle="270"></Appearance>

    <TextBlock>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></Appearance>
    </TextBlock>

    <Marker>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px"></Appearance>
    </Marker>
    </AxisLabel>
    </XAxis>

    <YAxis AxisMode="Normal" VisibleValues="All">
    <ScaleBreaks LineStyle="Sinusoid"></ScaleBreaks>

    <Appearance>
    <LabelAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></LabelAppearance>

    <TextAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></TextAppearance>
    </Appearance>

    <AxisLabel>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
            Dimensions-Margins="1px, 1px, 1px, 1px"
            Dimensions-Paddings="1px, 1px, 1px, 1px" RotationAngle="0"></Appearance>

    <TextBlock>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></Appearance>
    </TextBlock>

    <Marker>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px"></Appearance>
    </Marker>
    </AxisLabel>
    </YAxis>

    <YAxis2 AxisMode="Normal" VisibleValues="All">
    <ScaleBreaks LineStyle="Sinusoid"></ScaleBreaks>

    <Appearance>
    <LabelAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></LabelAppearance>

    <TextAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></TextAppearance>
    </Appearance>

    <AxisLabel>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3"
            Dimensions-Margins="1px, 1px, 1px, 1px"
            Dimensions-Paddings="1px, 1px, 1px, 1px" RotationAngle="0"></Appearance>

    <TextBlock>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></Appearance>
    </TextBlock>

    <Marker>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px"></Appearance>
    </Marker>
    </AxisLabel>
    </YAxis2>

    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="18%, 24%, 12%, 10%" Dimensions-Paddings="1px, 1px, 1px, 1px"></Appearance>
    </PlotArea>

    <Legend>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 2%, 1px, 1px" Dimensions-Paddings="2px, 2px, 2px, 3px">
    <ItemAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></ItemAppearance>

    <ItemTextAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></ItemTextAppearance>

    <ItemMarkerAppearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px"></ItemMarkerAppearance>
    </Appearance>

    <TextBlock>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px" Dimensions-Paddings="1px, 1px, 1px, 1px"></Appearance>
    </TextBlock>

    <Marker>
    <Appearance Corners="Rectangle, Rectangle, Rectangle, Rectangle, 3" Dimensions-Margins="1px, 1px, 1px, 1px"></Appearance>
    </Marker>
    </Legend>
            </rad:RadChart>
       
        </div>
        <asp:TextBox ID="TextBox1" runat="server" Width="323px"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click"
            Text="Set Data" />
        </form>
    </body>
    </html>

  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 04 Jun 2008 Link to this post

    Hello jmann,

    You should not have such issues with the latest RadChart for ASP.NET AJAX (2008.1.515). Give it a try and let us know if it works fine for you.

    Greetings,
    Ves
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Amy Liu
    Amy Liu avatar
    28 posts
    Member since:
    Dec 2009

    Posted 06 Jan 2010 Link to this post

    I am using 2009 Q2 and still get the problem and don't know why.
  5. Sudhanva
    Sudhanva avatar
    27 posts
    Member since:
    Apr 2009

    Posted 03 Feb 2010 Link to this post

    Any Solution for this post??

    Regards,
    Sudhanva
  6. Radhika Ganesh
    Radhika Ganesh avatar
    5 posts
    Member since:
    Jul 2009

    Posted 09 Feb 2010 Link to this post

    I am getting same error after I installed Visual studio 2008 Service pack1.  Telerik was installed prior to VS2009 sp1 and the chart was working.
    By the way, the Telerik versin I use is 2009.2.701.35

  7. Sudhanva
    Sudhanva avatar
    27 posts
    Member since:
    Apr 2009

    Posted 10 Feb 2010 Link to this post

    Hi Radhika,

    I have downloaded the files from http://www.telerik.com/downloads.aspx?fileid=9326&dispkey=True and added it in the GAC.

    This worked fine for me.

    Regards,
    Sudhanva
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017