Hi Anjali,
We have analyzed your query. Drilldown of the chart to grid cannot be achieved directly. For achieving you requirement we had used Ajax postback method. Please find a below code which is used to drilldown a chart according to a region clicked in a pie chart.
Code Snippet:
//Action method to handle postbacks in Grid
public ActionResult GridPartialView(PagingParams args)
{
IEnumerable data = new ChartDrillDownMVC.Models.StudentDataContext().Student.Take(100).ToList();
return data.GridActions<ChartDrillDownMVC.Models.Student>();
}
//Action method for drilldown
public ActionResult DrillDown(string Name, int index)
{
var data = new ChartDrillDownMVC.Models.StudentDataContext().Student.Take(100).ToList();
return PartialView("GridPartialView", data);
}
//Client-side function to handle mouse click event of chart
function MouseClick(sender, e)
{
if(e._currentItem.IsChartPoint)
{
//Using ajax request to drill down when chart point is clicked
$.ajax({
url: "/Chart/DrillDown",
data: { "Name": e._currentItem.SeriesName, "index":e._currentItem.PointIndex },
success: function (data) {
$("#Chart").html(data);
}
});
}
}
ScreenShot:
Normal piechart:
Piechart after one region is clicked:
We have prepared the workaround sample as per your requirement. Please find the sample from below location.
http://www.syncfusion.com/downloads/support/forum/119648/ze/Drilldown208885298
Regards,
Sanjith K.