Dundas Chart for ASP.NET
Load(TextReader) Method
See Also  Example Send comments on this topic.
Dundas.Charting.WebControl Namespace > ChartSerializer Class > Load Method : Load(TextReader) Method


reader

A reader that is derived from the abstract TextReader class (e.g. StringReader).


The text reader to load the data from.

Loads serialized data into the control from a reader object that derives from the TextReader class.


Loads all properties of the chart from the text reader. By setting Content or SerializableContent/NonSerializableContent properties specific set of properties can be loaded.

Syntax

Visual Basic (Declaration)  
Public Overloads Sub Load( _
   ByVal reader As TextReader _
) 
Visual Basic (Usage) Copy Code
Dim instance As ChartSerializer
Dim reader As TextReader
 
instance.Load(reader)
C#  
public void Load( 
   TextReader reader
)

Parameters

reader

A reader that is derived from the abstract TextReader class (e.g. StringReader).


The text reader to load the data from.

Example

The following example loads persisted appearance data into the control that is posted from the client to the server. Note that the ViewStateData property represents the actual data persisted in the web document.

Visual Basic Copy Code
Imports System.IO
Imports Dundas.Charting.Webcontrol
...

If IsPostBack Then

    Dim sr As New StringReader(Chart1.ViewStateData)
    Chart1.Serializer.Content = SerializationContent.Appearance
    Chart1.Serializer.Load(sr)

End If
C# Copy Code
using System.IO;
using Dundas.Charting.Webcontrol;
...

if(IsPostBack){
   
   StringReader sr =
new StringReader(Chart1.ViewStateData);
   Chart1.Serializer.Content = SerializationContent.Appearance;
   Chart1.Serializer.Load(sr);

}

Remarks

Call this method to load serialized data into the Chart control.

When a load operation occurs by default serializable properties are first reset to their default values before they are set to the persisted values (if saved). To change this behavior use the ResetWhenLoaded property.

By default all serialized chart properties will be loaded. By setting the Content, SerializableContent or NonSerializableContent properties a specific set of properties can be loaded.

When using this definition the format (set by the Format property) must be XML.

If the ViewStateData property is used to persist state then this method can be used to load the serialized data POSTED by the client back to the control . For more information see the State Management topic (also see the sample code below).

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.