Glossary Item Box
One of the unique features of WebAsyncRefreshPanel is its ability to have its hidden asynchronous postback fired by a control outside of the refresh panel. This topic walks you through the process of having a button on the form change the control inside the refresh panel using the refresh panels hidden asynchronous postback.
In this example, we will use the WebChart control inside the WARP Panel control. A button outside of the refresh panel will change the chart type, the data source, and re-render the chart, without the page posting back.
In Visual Basic:
Imports Infragistics.UltraChart.Shared.Styles
In C#:
using Infragistics.UltraChart.Shared.Styles;
In Visual Basic:
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.UltraChart1.DataSource = GetColumnData()
Me.UltraChart1.DataBind()
End Sub
In C#:
private void Page_Load(object sender, System.EventArgs e)
{
this.UltraChart1.DataSource = GetColumnData();
this.UltraChart1.DataBind();
}
In Visual Basic:
Private Sub btnChangeChart_Click(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles btnChangeChart.Click
If Me.UltraChart1.ChartType.ToString() = "ColumnChart" Then
Me.UltraChart1.ChartType = ChartType.RadarChart
Me.UltraChart1.DataSource = GetRadarData()
Me.UltraChart1.DataBind()
Else
Me.UltraChart1.ChartType = ChartType.ColumnChart
Me.UltraChart1.DataSource = GetColumnData()
Me.UltraChart1.DataBind()
End If
End Sub
In C#:
private void btnChangeChart_Click(object sender, System.EventArgs e)
{
if(this.UltraChart1.ChartType.ToString() == "ColumnChart")
{
this.UltraChart1.ChartType = ChartType.RadarChart;
this.UltraChart1.DataSource = GetRadarData();
this.UltraChart1.DataBind();
}
else
{
this.UltraChart1.ChartType = ChartType.ColumnChart;
this.UltraChart1.DataSource = GetColumnData();
this.UltraChart1.DataBind();
}
}