This is a migrated thread and some comments may be shown as answers.

Radchart not resize when use it with usercontrol

1 Answer 121 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
utchi
Top achievements
Rank 1
utchi asked on 23 Apr 2010, 10:45 AM
Hi,
I m using radchart in my application and I m having the following code in user control

Userconttrol

<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:RadChart>
       </telerik:RadAjaxPanel>
    </telerik:RadPane>
        <telerik:RadPane id="RadPane1" runat="server" Scrolling="None" Height="8%">
        <telerik:RadComboBox ID="ChartType1" runat="server" Visible="true" AutoPostBack="true" OnSelectedIndexChanged="ChartType1_SelectedIndexChanged">
              <Items>
              <telerik:RadComboBoxItem  Text="Bar" Value="2"/>
              <telerik:RadComboBoxItem  Text="Area" Value="3"/>
              </Items>
        </telerik:RadComboBox>
    </telerik:RadPane>
</telerik:RadSplitter>

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()
    {
    alert("Resizing");
 
        var manager = $find("RadAjaxManager1");
        manager.ajaxRequest();
    }

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" >
           <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="Cha1" LoadingPanelID="LoadingPanel1"/>                    
                    </UpdatedControls>
            </telerik:AjaxSetting>
              
            <telerik:AjaxSetting AjaxControlID="BindChart">
                   <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="Cha1" LoadingPanelID="LoadingPanel1"/>                    
                     </UpdatedControls>
            </telerik:AjaxSetting>
          </AjaxSettings>
</telerik:RadAjaxManager>
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
        <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;" />       
    </div>

Codebehind

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.

Regards,
Maha

1 Answer, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 27 Apr 2010, 04:27 PM
Hi,

Please, find attached an example which does this.

Kind 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.
Tags
Chart (Obsolete)
Asked by
utchi
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or