How can I best refresh a listview on a timely basis (automatically). I had a look at issue Q262250 which is a great help, but I keep getting the following error:
"Besturingselement RefreshTransportRequestsTimer van het type ASPxTimer moet binnen een form-label worden geplaatst met runat=server.".
What am I missing?
Thanks on beforehand.
We have closed this ticket because another page addresses its subject:
How to automatically refresh data in a View after a certain period of time on the WebHow to auto refresh a listview?
Answers approved by DevExpress Support
Hi Ad,
Thank you for posting your code snippet. It looks like you need to add the ASPxTimer control to the Page.Form.Controls collection, to resolve this problem:
C#void Frame_TemplateChanged(object sender, EventArgs e)
{
if (Frame.Template == null)
return;
Page p = (Page)Frame.Template;
if (p.FindControl("RefreshTransportRequestsTimer") != null)
return;
DevExpress.Web.ASPxTimer.ASPxTimer timer = new DevExpress.Web.ASPxTimer.ASPxTimer();
timer.ID = "RefreshTransportRequestsTimer";
timer.Tick += new EventHandler(timer_Tick);
timer.Interval = 10000;
timer.Enabled = true;
p.Form.Controls.Add(timer);
}
Please update your code accordingly, and let me know whether this helps.
Thanks,
Alex
@Ignas: We will be more than happy to research your project and help you avoid this error. Please create a separate ticket in the Support Center and post your problematic project there. Thanks!
@Kirsten: While we do not have a ready WinForms example for this particular scenario, I elaborated more on how to implement this at T164532.