Solved

How would I get items in a gridview to rotate or change every 5 seconds?

Posted on 2008-10-10
6
517 Views
Last Modified: 2012-05-05
I have a gridview that has bound items from a sql database and displays 1 item per page. Each item needs to rotate or change to the next item every 5 seconds. I don't want images so that is why I'm not using the ad rotator. Is this possible? If so, how would I accomplish it? Is there a better approach?

Thanks!
0
Comment
Question by:lsbgfl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 7

Expert Comment

by:the_bachelor
ID: 22689353
Well one way of doing this may be to load the set of data in memory say in a dataset.
then every 5 second or so you bind a different row to the grid...
Not saying this is the best approach, Just throwing ideas out there
0
 

Author Comment

by:lsbgfl
ID: 22689464
Which event should include the timing? I tried it in the page_load event and the gridview_load event without success. I'm using <asp:objectdatasource> to populate the gridview and not the code behind page (vb.net).
0
 
LVL 7

Accepted Solution

by:
the_bachelor earned 500 total points
ID: 22689532
U could:
- looking into using threading to Time your event
- look in to the MS Ajax Timer Control : http://www.asp.net/AJAX/Documentation/Live/tutorials/TimerControlWithUpdatePanelsTutorial.aspx
(neat, no?)
- look into placing the gridview on a usercontrol with auto refresh and feed what data to display to the uc.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:lsbgfl
ID: 22689998
It is in a user control. How would I incorporate auto refresh without using <meta http-equiv="refresh" content="5" />? Note: I'm also using a master page that I don't want to auto refresh. I'm not sure if auto refresh is the way to go, but I'd like to see if it would work. I've never used Ajax and do not have an Ajax website. The timer control is pretty cool though.
0
 

Author Comment

by:lsbgfl
ID: 22702906
How would I do it with threading?

From what I've read System.Threading.Thread and System.Timers.Timer are outside of the scope of the HTTPContext so I"m not quite sure how to incorporate gridview attributes.

Thanks.
0
 

Author Comment

by:lsbgfl
ID: 22704504
I'm going to try the Ajax timer control.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question