I have data grid and webchart on my page
I am creating the web chart and load the data grid when the page first load
The chart show fine, but when i click the sort column link the page refresh and the chart disappear.
Any idea on why the chart disappear
Sincerely yours
Riade Asleh
Hi Riade,
Based on my understanding, you create a web chart and bind DataGrid in the Page Load event. When you try to sort the DataGrid, the web chart disappears. If I have misunderstood you, please feel free to let me know.
When we sort the DataGrid, the page will postback. Please make sure that we create that web chart every time. In your case, we don't need to create the web chart with IsPostBack property in the Page Load event.
For example, we write the "Hello World" with IsPostBack property in the Page Load event. But if we click the Button (the page postbacks), the "Hello World" disappears:
<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Response.Write("Hello World!"); } } protected void Button1_Click(object sender, EventArgs e) { }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="PostBack" /></div> </form></body></html>
I hope this helps.
Are saying every time the page postback I have to recreate the chart, I am trying to avoid that
I thought the webchart control behave like the web form text box, where data entered in the text box will not be deleted if the page postback
Sincerely yours
Riade Asleh
0 comments:
Post a Comment