Hi,
I am using a telerik:RadRotator which rotates a bunch of RadHtmlChart (s) that show sales performance graphs in a slow rotating fashion. I am able to bind data at the server side to the RadRotator. I was able to find control for each individual RadHtmlChart. But the issue is that I am unable to extract the data item from the NamingContainer. Any help will be highly appreciated. Thanks in Advance.
Code block I am using is below.
Thanks,
Sudipta
I am using a telerik:RadRotator which rotates a bunch of RadHtmlChart (s) that show sales performance graphs in a slow rotating fashion. I am able to bind data at the server side to the RadRotator. I was able to find control for each individual RadHtmlChart. But the issue is that I am unable to extract the data item from the NamingContainer. Any help will be highly appreciated. Thanks in Advance.
Code block I am using is below.
Thanks,
Sudipta
protected void Page_Load(object sender, EventArgs e){ var summary = new SalesReports().GetSalesRepresentativeSummary(); this.RadRotator.DataSource = summary; this.RadRotator.DataBind();}protected void RadRotator_ItemDataBound(object sender, RadRotatorEventArgs e){ try { SalesRepresentativeSummary salesRepresentativeSummary = (SalesRepresentativeSummary)e.Item.DataItem; if (salesRepresentativeSummary != null) { // Populate sub section repeater RadHtmlChart SalesRepPerformanceRadHtmlChart = (RadHtmlChart)e.Item.FindControl("SalesRepPerformanceRadHtmlChart"); if (SalesRepPerformanceRadHtmlChart != null) { SalesRepPerformanceRadHtmlChart.DataBinding += new EventHandler(SalesRepPerformanceRadHtmlChart_DataBinding); // Show only active ones SalesRepPerformanceRadHtmlChart.DataSource = new List<SalesRepresentativeSummary> { salesRepresentativeSummary }; SalesRepPerformanceRadHtmlChart.DataBind(); } } } catch (Exception ex) { }}protected void SalesRepPerformanceRadHtmlChart_DataBinding(object sender, EventArgs e){ try { RadHtmlChart SalesRepPerformanceRadHtmlChart = (RadHtmlChart)sender; if (SalesRepPerformanceRadHtmlChart != null) {
// I need to find the IList<SalesRepresentativeSummary> and bind to the chart IList<SalesRepresentativeSummary> dataItem = (List<SalesRepresentativeSummary>)SalesRepPerformanceRadHtmlChart.NamingContainer; SalesRepPerformanceRadHtmlChart.ChartTitle.Text = "Hello" + " - It works"; } } catch (Exception ex) { }}