Lazy Load of RadHTMLChart in RadGrid

3 posts, 0 answers
  1. Pat Huesers
    Pat Huesers avatar
    18 posts
    Member since:
    Jan 2008

    Posted 25 Aug 2016 Link to this post

    I have a RadGrid that has a template column in it with RadHTMLChart.   The query for the data for the charts takes a few seconds per chart, so I would like to be able for the user to access the grid while the charts load via ajax.   I tried to set the datasource on the charts to nothing, and then declare the datasource with JS  on the OnGridCreated client event and bind them, but I am using a SQL Datasource for the chart.  It seems you can only use a JSON on the client side.   What is another approach to accomplish this?
  2. Pat Huesers
    Pat Huesers avatar
    18 posts
    Member since:
    Jan 2008

    Posted 25 Aug 2016 Link to this post

    OK, I dug in some more and thought the RadClientDataSource might be the bridge for this.   I cannot get that to work.  Here is the code  am using.   When I call DataSource.fetch(); it come back empty.   Any help would be appreciated!



    function LoadSparkLineCharts(sender, eventArgs) {
                   var masterTable = $find("<%=rgProjectDetails.ClientID%>").get_masterTableView();
                   var datePicker = masterTable.get_dataItems()[0].findControl('rcSparkLine');// Here 0 represents the index of crow in editmode
                   var dataSource = $find('<%= rcdsSparkline.ClientID %>');
                   var data = dataSource.fetch();

    <asp:SqlDataSource ID="sqlTest" runat="server" ConnectionString="<%$ ConnectionStrings:PLEDB %>" SelectCommand="select datepart(month,EventTime) as [Month],datepart(year,EventTime) as [Year],count(*) as [Cnt] from Something OD
    and od.EventTime>dateadd(year,-1,getdate())
    group by datepart(month,EventTime),datepart(year,EventTime)
    order by datepart(year,EventTime),datepart(month,EventTime)"></asp:SqlDataSource>
    <telerik:RadClientDataSource ID="rcdsSparkline" runat="server" >
                <DataSourceControlSettings DataSourceID="sqlTest" DataFields="Month,Year,Cnt" />
  3. Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 29 Aug 2016 Link to this post

    Hi Pat,

    Could you please refer to the answer in the support ticket that you have opened regarding the same issue. If further assistance is needed I would suggest that we continue the conversation in the support ticket.

    Best Regards,
    Konstantin Dikov
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top