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

Grid Offline Storage and Syncing once Online

3 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jako
Top achievements
Rank 1
Jako asked on 20 Nov 2014, 01:11 PM
Hello

How do I enable the telerik radgrids to be accessible offline and sync once online again?

Help much appreciate
Regards

3 Answers, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 24 Nov 2014, 02:02 PM
Hello Jako, 

This question has been posted in the UI For ASP.NET MVC forums, so I would assume that you are referring to the Kendo UI Grid, as RadGrid is part of the UI For ASP.NET AJAX. Basically, enabling this feature is done by setting the offlineStorage option, as described in the following article: Here is a live demo of the offline DataSource feature, which can be easily implemented in ASP.NET MVC using the OfflineStorage option, for example: 
@(Html.Kendo().Grid<ViewModel>()
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(....)
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .OfflineStorage("offline-kendo-demo")

Regards,
Alexander Popov
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.

 
0
El Chamo
Top achievements
Rank 2
answered on 30 Jul 2015, 12:44 AM

Hi,

 

In your example, how you can set the grid offline explicitly? Your code only specify the offlline store in the grid's Data Source but where you set when the grid go offline after it load the first time for example?

0
Alexander Popov
Telerik team
answered on 31 Jul 2015, 03:49 PM
Hello,

You can set the Grid's AutoBind option to false to prevent the initial Read request. Then, after the Grid is initialized - set the DataSource's offline mode to true. For example: 
@(Html.Kendo().Grid<ViewModel>()
    .Name("Grid")
    .AutoBind(false)
    .DataSource(dataSource => dataSource
        .Ajax()
        .OfflineStorage("offline-kendo-demo")
    ...
)
<script>
$(document).ready(function () {
    var grid = $("#Grid").data("kendoGrid");
    grid.dataSource.online(false);
});
</script>


Regards,
Alexander Popov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Jako
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
El Chamo
Top achievements
Rank 2
Share this question
or