Jump to content
Software FX Community

save toolbar to Sql Server


User (Legacy)

Recommended Posts

Hi

When using the dotnet toolbar on client side. Is there a way to get the

clientside settings in my codebehind aspx code? I want to store the data in

an databse.

Example:

I have a small webform with a chart ( enabled toolbar) and a button for a

roundtrip. In the toolbar i click the 3D Button so the chart is displayes

as 3D. Now I click the button and in my codebehind I ask the chart object

"this.chart1.Chart3D.ToString();" but it returns false.

So is there any way to get the settings?

regards

Bj

Link to comment
Share on other sites

What you need is what we call "Server-side Personalization".

To implement it you need to do two things:

1) Set:

this.Chart1.Personalized += new

SoftwareFX.ChartFX.Internet.Server.PersonalizedEventHandler(this.Chart1_Personalized);

Chart1.PersonalizedFlags |= PersonalizedFlags.ServerSide;

In your intialization code.

2) Handle the Personalized event as follows:

private void Chart1_Personalized(object sender,

SoftwareFX.ChartFX.Internet.Server.PersonalizedEventArgs e)

{

switch (e.Action) {

case PersonalizedAction.Save:

Chart1.Import(e.Stream);

e.Stream.Position = 0;

// Save stream to DB or file (In this example I'm saving to a

file)

System.IO.FileStream file =

System.IO.File.Create(@"d:\web\webapplication3\mychart.cfx");

byte [] data = new byte [e.Stream.Length];

e.Stream.Read(data,0,data.Length);

file.Write(data,0,data.Length);

file.Close();

TextBox1.Text = "Saved !";

break;

case PersonalizedAction.Load:

// Load Chart from File or DB using Import

Chart1.Import(FileFormat.Binary,@"d:\web\webapplication3\mychart.cfx");

break;

}

}

--

Francisco Padron

www.chartfx.com

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...