# Responding to Server Events

> caution **RadChart** has been deprecated since Q3 2014 and is marked as obsolete as of the 2026 Q2 SP1 (v2026.2.708) release. This is the last release that includes the RadChart component — its source code will be removed from the assembly in the next release. We strongly recommend using [RadHtmlChart](https://www.telerik.com/products/aspnet-ajax/html-chart.aspx), Telerik's modern client-side charting component.
> To transition from RadChart to RadHtmlChart, refer to the following migration articles:
>
> * [Migrating Series](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/changes-and-backwards-compatibility/migrating-from-radchart-to-radhtmlchart/migrate-series-configuration)
> * [Migrating Axes](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/changes-and-backwards-compatibility/migrating-from-radchart-to-radhtmlchart/migrate-axes-configuration)
> * [Migrating Date Axes](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/changes-and-backwards-compatibility/migrating-from-radchart-to-radhtmlchart/migrate-date-axis-configuration)
> * [Migrating Databinding](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/changes-and-backwards-compatibility/migrating-from-radchart-to-radhtmlchart/migrate-data-binding-configuration)
> * [Features parity](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/changes-and-backwards-compatibility/migrating-from-radchart-to-radhtmlchart/migrate-functionalities---features-and-series-types-parity)
>
> Explore the [RadHtmlChart documentation](https://www.telerik.com/products/aspnet-ajax/documentation/controls/htmlchart/overview) and online demos to determine how it fits your development needs.

Use the **RadChart OnClick** event to handle server postbacks caused by clicking on areas of the chart. Elements of the chart that have an ActiveRegion property can be used for information inside the **OnClick** event handler. The example below shows some of the commonly used chart elements that react to clicks including the chart title, x and y axis labels, series legends and items. The code example below shows a RadChart OnClick event handler evaluating the **ChartClickEventArgs** "Args" parameter. Use the Args.Element.ActiveRegion property to access the ToolTip, Url and Attributes for the ActiveRegion.

> caption Figure 1: RadChart active regions that can raise server-side click events

![RadChart active regions for the title, axes, legends, and series items](https://www.telerik.com/products/aspnet-ajax/documentation/assets/4c5e9a82e0d3a96910cca4c59278af8f/radchart-advanced001.png)

> caption Example: Subscribe to RadChart active-region click events

```C#
private void radChart1_Load(object sender, EventArgs e)
{
	// Attach the same handler to the chart title and each series item.
	radChart1.ChartTitle.ActiveRegion.Click += new RegionClickEventHandler(Region_Click);
	foreach (ChartSeries series in radChart1.Series) { foreach (ChartSeriesItem item in series.Items) { item.ActiveRegion.Click += new RegionClickEventHandle(Region_Click); } }
}
void Region_Click(object sender, RegionClickEventArgs args)
{
	string logFormat = "Item Class:{0} - \"{1}\"" + Environment.NewLine;
	if (sender is ChartTitle) { tbLog.Text += String.Format(logFormat, sender.GetType().Name, (sender as ChartTitle).TextBlock.Text); } else if (sender is ChartSeriesItem) { tbLog.Text += String.Format(logFormat, sender.GetType().Name, (sender as ChartSeriesItem).Name); }
}
```

```VB
Private Sub radChart1_Load(ByVal sender As Object, ByVal e As EventArgs)
	AddHandler radChart1.ChartTitle.ActiveRegion.Click, AddressOf Region_Click
	For Each series As ChartSeries In radChart1.Series
		For Each item As ChartSeriesItem In series.Items
			AddHandler item.ActiveRegion.Click, AddressOf Region_Click
		Next
	Next
End Sub
Sub Region_Click(ByVal sender As Object, ByVal args As RegionClickEventArgs)
	Dim logFormat As String = "Item Class:{0} - ""{1}""" + Environment.NewLine
	If TypeOf sender Is ChartTitle Then
		tbLog.Text += [String].Format(logFormat, sender.[GetType]().Name, (TryCast(sender, ChartTitle)).TextBlock.Text)
	ElseIf TypeOf sender Is ChartSeriesItem Then
		tbLog.Text += [String].Format(logFormat, sender.[GetType]().Name, (TryCast(sender, ChartSeriesItem)).Name)
	End If
End Sub
```

To react to server events in RadChart handle the Click event for a report item ActiveRegion in code. Determine the type of the clicked object by checking the "sender" object passed to the event handler. Cast "sender" to that type to use its properties and methods. See the code example below. In the radChart1_Load the ChartTitle and ChartSeriesItems both have ActiveRegion properties. The ActiveRegion.Click is assigned the "Region_Click" event handler. In "Region_Click" the Sender class is determined. For example if Sender is a ChartTitle type, Sender is cast to be a ChartTitle and its **TextBlock.Text** property is accessed.

> caption Figure 2: RadChart click handling for a selected chart element

![RadChart displaying the selected element information from a click event](https://www.telerik.com/products/aspnet-ajax/documentation/assets/5ce8c53dc3ebc2f3b18ed6c22358f570/radchart-advanced002.png)

> caption Example: Identify the clicked RadChart element

```C#
private void radChart1_Load(object sender, EventArgs e)
{
	// Register the handler for the title and every series item.
	radChart1.ChartTitle.ActiveRegion.Click += new RegionClickEventHandler(Region_Click);
	foreach (ChartSeries series in radChart1.Series) { foreach (ChartSeriesItem item in series.Items) { item.ActiveRegion.Click += new RegionClickEventHandler(Region_Click); } }
}
void Region_Click(object sender)
{
	string logFormat = "Item Class:{0} - \"{1}\"" + Environment.NewLine;
	if (sender is ChartTitle) { tbLog.Text += String.Format(logFormat, sender.GetType().Name, (sender as ChartTitle).TextBlock.Text); } else if (sender is ChartSeriesItem) { tbLog.Text += String.Format(logFormat, sender.GetType().Name, (sender as ChartSeriesItem).Name); }
}
```

```VB
Private Sub radChart1_Load(ByVal sender As Object, ByVal e As EventArgs)
	AddHandler radChart1.ChartTitle.ActiveRegion.Click, AddressOf Region_Click
	For Each series As ChartSeries In radChart1.Series
		For Each item As ChartSeriesItem In series.Items
			AddHandler item.ActiveRegion.Click, AddressOf Region_Click
		Next
	Next
End Sub
Sub Region_Click(ByVal sender As Object, ByVal args As RegionClickEventArgs)
	Dim logFormat As String = "Item Class:{0} - ""{1}""" + Environment.NewLine
	If TypeOf sender Is ChartTitle Then
		tbLog.Text += [String].Format(logFormat, sender.[GetType]().Name, (TryCast(sender, ChartTitle)).TextBlock.Text)
	ElseIf TypeOf sender Is ChartSeriesItem Then
		tbLog.Text += [String].Format(logFormat, sender.[GetType]().Name, (TryCast(sender, ChartSeriesItem)).Name)
	End If
End Sub
```
