Hi
I hope you can help. We are implementing a .NET reporting dashboard whereby our page will consist of multiple RadHtmlChart controls. Each control sits in its own web part called from the parent page and housed in RadDocks.
For performance reasons we'd like the charts to render asynchronously. We have tried to achieve this using a web service in the manner shown below.
However, the charts do not render at all. Any other control we place in our web parts work fine (dropdown, radgrid etc.). Just not RadHtmlChart. Have you any ideas why this would be? Should we be using another method of doing this?
function DockInitialize(dock, args) {
logIt("INVOKE WidgetsWebService:" + dock.get_id());
var dockID = dock.get_id();
var CompanyID = $get(dockID).attributes["CompanyID"].value;
Revolution.WidgetsWebService.GetData(CompanyID, function (result) {
$get(dockID + "_C").innerHTML = result;
logIt("END INVOKE WidgetsWebService:" + dock.get_id());
});
}
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/Services/WidgetsWebService.asmx" />
</Services>
</asp:ScriptManager>
------------------------------------------------------------------------------------------------------------------------------
<System.Web.Script.Services.ScriptService()>
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class WidgetsWebService
Inherits System.Web.Services.WebService
<WebMethod()>
Public Function GetData(ByVal elementID As String) As String
Thread.Sleep(2000)
If elementID = String.Empty Then
Throw New Exception("No Value argument is provided to the webservice!")
End If
Return ViewManager.RenderView("~/Dev/Consultants/Dashboard/Widgets/Other/TestControl.ascx")
End Function
End Class
------------------------------------------------------------------------------------------------------------------------------
Public Shared Function RenderView(ByVal path As String) As String
Thread.Sleep(200)
Dim pageHolder As Test = New Test()
Dim tempForm As HtmlForm = New HtmlForm()
tempForm.ID = "TempForm"
pageHolder.Controls.Add(tempForm)
Dim viewControl As UserControl = CType(pageHolder.LoadControl(path), UserControl)
viewControl.ID = Guid.NewGuid().ToString()
Dim scriptManager As New ScriptManager()
tempForm.Controls.Add(scriptManager)
tempForm.Controls.Add(viewControl)
Dim output As StringWriter = New StringWriter()
HttpContext.Current.Server.Execute(pageHolder, output, False)
Dim result As String = output.ToString()
Return result
End Function
------------------------------------------------------------------------------------------------------------------------------
and this is our TestControl.ascx web part
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="TestControl.ascx.vb" Inherits="Revolution.TestControl" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<div id="content">
<telerik:RadHtmlChart runat="server" ID="ColumnChart">
<PlotArea>
<Series>
<telerik:ColumnSeries Name="Wooden Table">
<SeriesItems>
<telerik:CategorySeriesItem Y="25000"></telerik:CategorySeriesItem>
<telerik:CategorySeriesItem Y="12000"></telerik:CategorySeriesItem>
</SeriesItems>
</telerik:ColumnSeries>
</Series>
<XAxis>
<Items>
<telerik:AxisItem LabelText="1"></telerik:AxisItem>
</Items>
<TitleAppearance Position="Center" RotationAngle="0" Text="Quarters">
</TitleAppearance>
</XAxis>
<YAxis>
<LabelsAppearance DataFormatString="{0} sales" RotationAngle="0" Skip="0" Step="1"></LabelsAppearance>
<TitleAppearance Position="Center" RotationAngle="0" Text="Sales">
</TitleAppearance>
</YAxis>
</PlotArea>
</telerik:RadHtmlChart>
</div>