ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Clickable chart with gridview
Posted by April on Apr-20-2011 11:21
Hi Peter,


Is it possible to do click on particular bar graph to display data in grid view? i know i can do by redirecting to new page but i want to display in same page with grid view? any advice? thank you.

April

  Re: Clickable chart with gridview
Posted by Peter Kwan on Apr-21-2011 16:06
Hi April,

You can use the post back URL as the URL in the clickable bar. In this way, when the bar is clicked, it will postback to the same page (similar to when an ASP.NET button is clicked). In your ASPX, you can check if this is a postback event and handle it accordingly (by displaying something in a grid view).

The post back URL can be obtained by using WebChartViewer.GetPostBackURL. For example, in C#:

WebChartViewer1.ImageMap = c.getHTMLImageMap(WebChartViewer1.GetPostBackURL(), " ", "title='{value}'");

You may refer to the documentation on WebChartViewer1.GetPostBackURL() for more details.

Hope this can help.

Regards
Peter Kwan

  Re: Clickable chart with gridview
Posted by April on Apr-21-2011 16:36
Hi Peter ,

Thanks for reply.I read through WebChartViewer.GetPostBackURL and found out
WebChartViewer1.ImageMap = c.getHTMLImageMap(WebChartViewer1.GetPostBackURL());

current my code passing parameter to the URL to get the gridview data. how can i get this parameter value pass to gridview in same page? Many thanks.

WebChartViewer3.ImageMap = c_prev.getHTMLImageMap("Country_Details.aspx?year=" +
          ddlShowYear1 + "&showcode=" + ddlShowCode, "",
            "title='{label}: sqm {value}({percent}%)'");

April

  Re: Clickable chart with gridview
Posted by Peter Kwan on Apr-21-2011 17:52
Hi April,

The WebChartViewer postback is just a standard postback, similar to a postback generated by a standard ASP.NET push button. You should not need to pass any parameter in the URL. If you need any parameter, you may store it in a hidden field (exactly like what you would do if you are using a push button). See:

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hiddenfield.aspx

Hope this can help.

Regards
Peter Kwan

  Re: Clickable chart with gridview
Posted by April on Apr-26-2011 10:59
Hi Peter,

Thanks for the guide. Will try today.

April