|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 6/28/2008 6:24:14 AM
Posts: 1,
Visits: 15
|
|
| Hi. I created a MSLine chart with strXML generated from the data displayed on GridView and it works fine. I want to update the chart when GridView is sorted but it didn't work at all. Can anybody tell me how to run createchart() whenerver I want to pull the triger like sorted or cliked? I tried this but this didn't work. Protected Sub GridView1_Sorted(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.Sortedcreatechart() End Sub
Toshiyuki Saito
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: Yesterday @ 11:57:55 PM
Posts: 630,
Visits: 1,916
|
|
Hi Toshiyuki Saito, Please build the XML again in the "sorted" event and re-render the chart. You can call createchart() [where this XML building and re-rendering of chart occurs] from GridView1_Sorted event. In createchart() please read data from grid view control object rather than the datasource. Please see the code below for createChart() which you might use and modify in our application.---------------------------------------------------------------------- Protected Sub GridView1_Sorted(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SortedCreateChart() End Sub------------------------------------------------------------------------- Public Sub CreateChart() Dim strXML As New StringBuilder()strXML.Append( "<chart>")Dim i As IntegerFor i = 0 To GridView1.Rows.Count - 1strXML.Append( "<set value='" & GridView1.Rows(i).Cells(1).Text & "' label='" & GridView1.Rows(i).Cells(0).Text & "' />")NextstrXML.Append( "</chart>")Literal1.Text = FusionCharts.RenderChart( "FusionCharts/Column2D.swf", "", strXML.ToString(), "ChartID", "350", "300", False, False)End Sub
Thanks,
Arindam FusionCharts Team
www.fusioncharts.com
|
|
|
|