Hi,
the suggested solution might be nice but my chart reside in usercontrol and my appl need to register to a specific event
of my usercontrol to know on which graphic bar the user clicked. How could I have the same kind of eventargs between
my label click and graphic bar click because I have to raise an event to my app because my app need to know some infos
from the raise eventargs parameters.
Here is the content of my UserControl:
public event EventHandler<ChartItemClickEventArgs> ChartItemClick;
private void ChartArea_ItemClick(object sender, ChartItemClickEventArgs e)
{
if (ChartItemClick != null)
{
ChartItemClick(sender, e);
}
}
private void ChartArea_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var originalSource = e.OriginalSource as DependencyObject;
var seriesItemLabel = Telerik.Windows.Controls.ParentOfTypeExtensions.GetVisualParent<SeriesItemLabel>(originalSource);
if (seriesItemLabel != null)
{
//TODO: Simulate the associated bar click
//seriesItemLabel.DataPoint.DataItem as Your busness object == RadButton associated to a graphicbar
}
}
Here is the code in my app when the user click on a graph bar of my usercontrol:
private void GraphicItemClick(object sender, ChartItemClickEventArgs e)
{
if (e.DataPoint.DataItem != null && e.DataPoint.DataItem is RadButton)
{
radButton_Click(e.DataPoint.DataItem as RadButton, null);
}
}
Thank's