Take the 2-minute tour ×

I need some kind of code which will refresh the page every 5min and if not the page then just the Telerik grid displayed on it since that's all that's rly needed.

Only other thing would be if it was after 5min of no activity on the page if possible but it's not core feature.

share|improve this question
would be nice if whom ever down voted me explained why so I could improve/correct on what ever is wrong. –  Myzifer Apr 6 '11 at 11:41
add comment

6 Answers

up vote 6 down vote accepted

One possibility is to use a meta refresh tag:

<meta http-equiv="refresh" content="300" />

Another possibility is to use the window.setInterval method to send periodic AJAX requests to a controller action and update the DOM:

window.setInterval(function() {
    // Send an AJAX request to a controller action which will
    // return a partial with the grid and update the DOM
        url: '/grid',
        success: function(result) {
}, 300000);

And to implement the idle functionality you could use the jquery idle plugin.

share|improve this answer
would this just refresh the grid itself and could it be used on $("#cal").datepicker({ dateFormat: 'dd/mm/yy', onSelect: function (dt, inst) { $('#blahList').data('tGrid').rebind({ ndate: dt }); } }); which changes the recorded displayed based on the date selected? –  Myzifer Apr 12 '11 at 12:05
@Myzifer, if you use AJAX in the success callback you could replace whatever portion of the DOM you like with the new contents including only the grid. –  Darin Dimitrov Apr 12 '11 at 12:12
it is a ajax databinding but the problem is I think I need to make a hidden or maybe a hiddenfor and store the rebinded date in so that the refresh will refresh the grid based on that date right? –  Myzifer Apr 13 '11 at 8:34
how it request sort ordered, grouping, paging parameters? it will request "very" fresh grid. –  Nuri YILMAZ Jul 14 '11 at 11:08
When I get a chance I'll try this out but so that I don't forget to mark this question as answered and since this answer has the temp solution I'm using and potentially the best solution which just refreshs the grid and on a timer then I'm gona mark this as the correct answer. –  Myzifer Jul 26 '11 at 14:48
add comment

keep it simple, call refreshGrid() function when you need to refresh grid.

function refreshGrid() {
    if ($(".t-grid .t-refresh").exists()) {
        $(".t-grid .t-refresh").trigger('click');

/*return true if does selected element exist.*/
(function ($) {
    $.fn.exists = function () { return jQuery(this).length > 0; }
share|improve this answer
add comment
share|improve this answer
if it works straight w/o a issue then I'll prob be using this till I can get Darin's solution working unless does the timeout bit of this mean it's a timeout on idle status? –  Myzifer Apr 6 '11 at 12:47
It means that passed function will be called after 5 minutes, that's all. I've corrected it a bit. I had mistake in window.reload(). window.location.reload() must be called. –  Headshota Apr 6 '11 at 12:52
Do you know how I would instead of window.location.reload() that I could instead bind it just to the grid inself to reload since I have $("#cal").datepicker({ dateFormat: 'dd/mm/yy', onSelect: function (dt, inst) { $('#BlahList').data('tGrid').rebind({ ndate: dt }); } }); which will change the displayed records to which ever date selected but if possible I'd like to tie in the date selected into the reload by just reloading the grid. –  Myzifer Apr 12 '11 at 12:03
add comment

If your grid is set up for ajax refreshes, then you can use something like

    <script type="text/javascript">
        $(function() {
            setInterval(function() {
            }, 300000);
share|improve this answer
add comment

For Server Bindings Telerik Grid Just need to do the following Thing..... Just use and cheers

After any event you can call this

   var href = $('.t-refresh').attr('href');
    window.location.href = href;
share|improve this answer
add comment

If you are using Ajax or Webservice binding on the Telerik Grid, you can call the rebind() method on the grid object. That will force it to call the Select method of the binding again to get the latest data.

If you combine the rebind() call with Darin's answer of using the SetInterval method, it should give you what you are after.

share|improve this answer
add comment

Your Answer


