This is a migrated thread and some comments may be shown as answers.

htmlchart in not changing during drill down

1 Answer 3 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
umair
Top achievements
Rank 1
umair asked on 03 Jul 2014, 01:11 PM
hi,
i am facing a problem that while doing drill down in htmlchat  when clicking on the series the method onClintSeriesClick calls but there is no effect on the graph. my code is..

<telerik:RadAjaxManager runat="server" ID="ajaxmanager" OnAjaxRequest="ajaxmanager_AjaxRequest">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="ajaxmanager">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="main_div" LoadingPanelID="LoadingPanel1"></telerik:AjaxUpdatedControl>
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadScriptManager runat="server"></telerik:RadScriptManager>
            <telerik:RadCodeBlock ID="codeBlock" runat="server">
                <script type="text/javascript">
                    function OnClientSeriesClicked(sender, args) {
                        $find("<%= ajaxmanager.ClientID %>").ajaxRequest(args.get_category());
                    }
                </script>
            </telerik:RadCodeBlock>
            <div runat="server" id="main_div">
            <telerik:RadHtmlChart runat="server" ID="chart1" OnClientSeriesClicked="OnClientSeriesClicked">
                <PlotArea>
                    <Series>
                        <telerik:ColumnSeries Name="abc" DataFieldY="data"></telerik:ColumnSeries>
                    </Series>
                    <XAxis DataLabelsField="label"></XAxis>
                </PlotArea>
            </telerik:RadHtmlChart>
                <asp:SqlDataSource ConnectionString="server=.\sqlexpress;database=record;integrated security=SSPI" SelectCommand="select * from tab1" ID="datasource1" runat="server">

                </asp:SqlDataSource>
                <asp:SqlDataSource ConnectionString="server=.\sqlexpress;database=record;integrated security=SSPI" SelectCommand="select * from tab2" ID="datasource2" runat="server">

                </asp:SqlDataSource>
                </div>
            <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" Height="77px" Width="113px" runat="server">
            </telerik:RadAjaxLoadingPanel>

cs file is.
 public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           // ajaxmanager_AjaxRequest(sender,new AjaxRequestEventArgs("umair"));

            if (!IsPostBack)
            {
                chart1.DataSourceID = "datasource1";
                chart1.DataBind();
            }
        }

        protected void ajaxmanager_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {

            if (e.Argument.ToString() == "umair")
            {
                //chart1.DataSource = Class1.dt2;
                chart1.PlotArea.Series[0].Name = "data";
                chart1.DataSourceID = "datasource2";
              
            }
        }

please help me out

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 07 Jul 2014, 01:20 PM

Hello Umair,

Please make sure that:

  • the condition in the AjaxRequest handler is met. This means that the category that is clicked must be "umair" in your example while the chart has abc.
  • the chart is part of the partial rendering that comes down from the browser
  • the settings that you apply can work without AJAX (e.g., apply them on a simple button Click). Depending on the new data that is passed the old chart configuration may need more changes than just a series name. Once thigns work with full postbacks, they should work with partial ones as well, but full postbacks are easier to debug.

I would also advise that you examine this demo's code carefully to see how we have implemented such a scenario and where the series data and code-behind need to match (e.g., the series Name): http://demos.telerik.com/aspnet-ajax/htmlchart/examples/drilldownchart/defaultcs.aspx.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
umair
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or