tosaito Report post Posted June 24, 2008 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.Sorted createchart() End Sub Share this post Link to post Share on other sites
Arindam Report post Posted June 26, 2008 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 Integer For 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 Share this post Link to post Share on other sites