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

Lazy Load of RadHTMLChart in RadGrid

2 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pat Huesers
Top achievements
Rank 1
Pat Huesers asked on 25 Aug 2016, 03:23 PM
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 Answers, 1 is accepted

Sort by
0
Pat Huesers
Top achievements
Rank 1
answered on 25 Aug 2016, 06:22 PM

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) {
               debugger;
               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();
               datePicker.set_dataSource(data);
           }

<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" >
        <DataSource>
            <DataSourceControlSettings DataSourceID="sqlTest" DataFields="Month,Year,Cnt" />
        </DataSource>
    </telerik:RadClientDataSource>
0
Konstantin Dikov
Telerik team
answered on 29 Aug 2016, 07:12 AM
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.
Tags
Grid
Asked by
Pat Huesers
Top achievements
Rank 1
Answers by
Pat Huesers
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or