sing System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using System.Drawing;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
using Telerik.WebControls;
using Telerik.WebControls.Dialogs;
using Telerik.Charting;
using Telerik.Charting.Styles;
namespace telerik
{
[Guid("fabcf876-e087-4609-8c4c-b236a86750c7")]
public class telchart : Microsoft.SharePoint.WebPartPages.WebPart
{
private bool _error = false;
private string _myProperty = null;
[Personalizable(PersonalizationScope.Shared)]
[WebBrowsable(true)]
[System.ComponentModel.Category("My Property Group")]
[WebDisplayName("MyProperty")]
[WebDescription("Meaningless Property")]
public string MyProperty
{
get
{
if (_myProperty == null)
{
_myProperty = "Hello SharePoint";
}
return _myProperty;
}
set { _myProperty = value; }
}
public telchart()
{
this.ExportMode = WebPartExportMode.All;
}
/// <
summary
>
/// Create all your controls here for rendering.
/// Try to avoid using the RenderWebPart() method.
/// </
summary
>
///
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
RenderChildren(writer);
}
protected override void CreateChildControls()
{
if (!_error)
{
try
{
base.CreateChildControls();
base.CreateChildControls();
RadChart myc = new RadChart();
ChartSeries mcs = new ChartSeries();
mcs.Type = ChartSeriesType.Pie;
myc.RadControlsDir = "~/_layouts/RadControls/";
Controls.Add(myc);
}
catch (Exception ex)
{
HandleException(ex);
}
}
}
/// <
summary
>
/// Ensures that the CreateChildControls() is called before events.
/// Use CreateChildControls() to create your controls.
/// </
summary
>
/// <
param
name
=
"e"
></
param
>
protected override void OnLoad(EventArgs e)
{
if (!_error)
{
try
{
base.OnLoad(e);
this.EnsureChildControls();
}
catch (Exception ex)
{
HandleException(ex);
}
}
}
/// <
summary
>
/// Clear all child controls and add an error message for display.
/// </
summary
>
/// <
param
name
=
"ex"
></
param
>
private void HandleException(Exception ex)
{
this._error = true;
this.Controls.Clear();
this.Controls.Add(new LiteralControl(ex.Message));
}
}
}
im developing a telerik chart web part in moss 2007, here is the code
the problem is that when the web part loads im not getting any image of a chart ive attached a jpeg image...
any suggestions ? thanks