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