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

Refresh Grid automatically?

4 Answers 212 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 30 Jul 2008, 04:47 PM
Is there a setting similar to a meta refresh in the grid so that it would refresh every 10 minutes or so?

4 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 30 Jul 2008, 05:07 PM
Hello George,

RadGrid does not provide such functionality, however, you can use RadAjaxTimer:

http://www.telerik.com/help/aspnet/ajax/ajxtimer.html

Regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mike
Top achievements
Rank 1
answered on 30 Jul 2008, 06:36 PM
Dimo,

I treid and got an error!

Parser Error Message: Unknown server tag 'telerik:RadAjaxTimer'.  
 

Any other ideas would be helpful.

Thanks!
0
Mike
Top achievements
Rank 1
answered on 30 Jul 2008, 06:59 PM
I have found an eligant yet simple solution, here is what I put in the aspx page
<asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Interval="30000" /> 
<asp:Label ID="Label1" runat="server" Text="Grid not refreshed yet."></asp:Label><br /> 
In between here is your radGrid
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" KeepInScreenBounds="True" Modal="true" VisibleStatusbar="false">  
 <AjaxSettings> 
    <telerik:AjaxSetting AjaxControlID="Timer1">  
      <UpdatedControls> 
          <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
      </UpdatedControls> 
    </telerik:AjaxSetting>                  
 </AjaxSettings> 
</telerik:RadAjaxManager> 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="20">  
     <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0;" /> 
</telerik:RadAjaxLoadingPanel> 

Code Behind
protected void Timer1_Tick(object sender, EventArgs e)  
{                                                                                               Label1.Text = "Grid Refreshed at: " + DateTime.Now.ToLongTimeString();  
  BindGrid();               

It is a slightly modified version of this code:
Link to Source
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Mike
Top achievements
Rank 1
Vladimir
Top achievements
Rank 1
Share this question
or