I have a drop down list to choose which chart to display.
When I choose a chart - the whole page is rerendered instead of just my warp!?
How to achieve that just warp refreshes? Any idea?
<asp:DropDownList ID="ddl_ChartNames" runat="server" AutoPostBack="True" /> <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" TriggerControlIDs="ddl_ChartNames" RefreshTargetIDs="chart_Main" > <igchart:UltraChart ID="chart_Main" runat="server" Visible="false" Width="100%"> </igchart:UltraChart> </igmisc:WebAsyncRefreshPanel>
Actually you can try this
<asp:DropDownList ID="ddl_ChartNames" runat="server" AutoPostBack="FALSE" />
<igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" TriggerControlIDs="ddl_ChartNames"> <igchart:UltraChart ID="chart_Main" runat="server" Visible="false" Width="100%"> </igchart:UltraChart> </igmisc:WebAsyncRefreshPanel>
if this does not work, attach a client onchange event to drop down like this on server side
ddl_ChartNames.attributes.Add("onchange","ddl_ChartNameChange()");
now the JS function will be used to refresh the warp explicitly, onchange of the dropdown.
function ddl_ChartNameChange()
{
var warp = ig_getWebControlById('WebAsyncRefreshPanel1');
if(warp){ warp.refresh(); }
if(warp)
warp.refresh();
}
Thanks,
Praveen.
This is how I load charts on a server side:
Protected Sub ddl_ChartNames_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl_ChartNames.SelectedIndexChanged Trace.Write("Part_Graph.ascx:ddl_ChartNames_SelectedIndexChanged") ' Retrieve available charts Dim oPlugins As New ChartPlugin oCharts = oPlugins.LoadCharts(Me.Context.Items("g_Login_Org_Tp"), Me.Context.Items("g_Login_Org_Id"), Me.Context.Items("g_Login_Auth_Cd")) oPlugins = Nothing Call GenerateChart(oCharts(ddl_ChartNames.Items(ddl_ChartNames.SelectedIndex).Text)) End Sub
I mean, change in a drop down list does not load different chart.
Thanks a lot Anand I've already tried that, but in that case nothing happens :-(.
put that dropdown inside warp like this and it should be fine.
<igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" TriggerControlIDs="ddl_ChartNames" RefreshTargetIDs="chart_Main" >
<asp:DropDownList ID="ddl_ChartNames" runat="server" AutoPostBack="True" /> <igchart:UltraChart ID="chart_Main" runat="server" Visible="false" Width="100%"> </igchart:UltraChart> </igmisc:WebAsyncRefreshPanel>