Radchart not resize when use it with usercontrol

Thread is closed for posting
2 posts, 1 answers
  1. utchi
    utchi avatar
    36 posts
    Member since:
    May 2009

    Posted 23 Apr 2010 Link to this post

    I m using radchart in my application and I m having the following code in user control


    <telerik:RadSplitter id="RadSplitter4" runat="server" Orientation="Horizontal">
        <telerik:RadPane id="LeftPane1" runat="server" Scrolling="None">       
           <telerik:RadAjaxPanel ID="fsdg" runat="server">
            <telerik:RadChart ID="RadChart1" runat="server" DefaultType="Bar" OnClick="DetailedGraph_Click">
                    <ClientSettings ScrollMode="None" />
            <telerik:RadPane id="RadPane1" runat="server" Scrolling="None" Height="8%">
            <telerik:RadComboBox ID="ChartType1" runat="server" Visible="true" AutoPostBack="true" OnSelectedIndexChanged="ChartType1_SelectedIndexChanged">
                  <telerik:RadComboBoxItem  Text="Bar" Value="2"/>
                  <telerik:RadComboBoxItem  Text="Area" Value="3"/>

    and i m trying to resize the chart by using the following code in a webpage,

    but it doesn't work at first time when button click.

    Code in .aspx page

    function reload()
            var manager = $find("RadAjaxManager1");

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" >
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                           <telerik:AjaxUpdatedControl ControlID="Cha1" LoadingPanelID="LoadingPanel1"/>                    
                <telerik:AjaxSetting AjaxControlID="BindChart">
                           <telerik:AjaxUpdatedControl ControlID="Cha1" LoadingPanelID="LoadingPanel1"/>                    
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            <ucl:ChartCtrl ID="Cha1" runat="server" />
            <asp:Button ID="BindChart" runat="server" Text="BindChart" OnClick="BindChart_Click" />
            <asp:Button ID="ResizeChart" runat="server" Text="ResizeChart" OnClientClick="reload(); return false;" />       


    Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs)
            radchart1 = DirectCast(Cha1.FindControl("RadChart1"), RadChart)
            radchart1.Height = System.Web.UI.WebControls.Unit.Pixel(Integer.Parse(radchart1.Height.Value.ToString()) + 80)
            radchart1.Width = System.Web.UI.WebControls.Unit.Pixel(Integer.Parse(radchart1.Width.Value.ToString()) + 100)
    End Sub

    Chart not change it size i m clicking the button first time. I think the problem might be in usercontrol.

    Please give any suggestions to solve it.


  2. Answer
    Ves avatar
    2926 posts

    Posted 27 Apr 2010 Link to this post


    Please, find attached an example which does this.

    Kind regards,
    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.
Back to Top