Hi,
I am using Defualt2.zip file.
But i am getting an null exception in the following line.
RadAjaxManager.GetCurrent(this).AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManager1_AjaxRequest);
The code as follows.
Aspx file:
<%
@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="Test2.Default" Title="Untitled Page" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Charting" TagPrefix="telerik" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function ResizeChart_ServerSide(sender, args) {
request(sender);
}
function request(sender) {
var ajaxManager = $find('<%= RadAjaxManager.GetCurrent(this).ClientID %>');
var arg1 = sender.get_width() + "px";
var arg2 = sender.get_height() + "px";
var arguments = arg1 + "," + arg2;
ajaxManager.ajaxRequest(arguments);
}
</script>
</telerik:RadScriptBlock>
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="Server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadChart1" />
<telerik:AjaxUpdatedControl ControlID="isInitialLoad" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<asp:HiddenField ID="isInitialLoad" Value="1" runat="server" />
<telerik:RadSplitter ID="RadSplitter2" runat="server">
<telerik:RadPane ID="RadPane1" runat="server" Width="10px" Scrolling="none">
</telerik:RadPane>
<telerik:RadSplitBar ID="Radsplitbar1" runat="server"></telerik:RadSplitBar>
<telerik:RadPane ID="RadPane2" runat="server" Height="800px" Width="600px">
<telerik:RadSplitter ID="Radsplitter4" runat="server" Height="100%" Width="100%"
Orientation="Horizontal">
<telerik:RadPane ID="Radpane3" runat="server" Height="100%" Width="100%" Scrolling="none"
OnClientResized="ResizeChart_ServerSide">
<telerik:RadChart ID="RadChart1" runat="server">
<Series>
<telerik:ChartSeries>
<Items>
<telerik:ChartSeriesItem YValue="3">
</telerik:ChartSeriesItem>
<telerik:ChartSeriesItem YValue="6">
</telerik:ChartSeriesItem>
<telerik:ChartSeriesItem YValue="2">
</telerik:ChartSeriesItem>
<telerik:ChartSeriesItem YValue="1">
</telerik:ChartSeriesItem>
<telerik:ChartSeriesItem YValue="5">
</telerik:ChartSeriesItem>
<telerik:ChartSeriesItem YValue="4">
</telerik:ChartSeriesItem>
</Items>
</telerik:ChartSeries>
</Series>
</telerik:RadChart>
</telerik:RadPane>
<telerik:RadSplitBar ID="Radsplitbar4" runat="server"></telerik:RadSplitBar>
<telerik:RadPane ID="Radpane6" runat="server" Height="50px">
</telerik:RadPane>
</telerik:RadSplitter>
</telerik:RadPane>
</telerik:RadSplitter>
Aspx.cs file.
---------------
using
System;
using
System.Data;
using
System.Configuration;
using
System.Collections;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
using
Telerik.Web.UI;
namespace
Test2
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
RadAjaxManager.GetCurrent(this).AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(RadAjaxManager1_AjaxRequest);
}
protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
isInitialLoad.Value =
"0";
string argument = (e.Argument);
String[] stringArray = argument.Split(",".ToCharArray());
RadChart1.Width =
new Unit(stringArray[0]);
RadChart1.Height =
new Unit(stringArray[1]);
}
}
}
Webconfig file
--------------------
<?
xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<
configuration>
<
appSettings/>
<
connectionStrings/>
<
system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<
compilation debug="true">
<
assemblies>
<
add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<
add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</
assemblies>
</
compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<
authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</
system.web>
</
configuration>
Please have attached file as PNG file.
Please let me know if I have missed any thing.
Regards
mainak