Solved

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

Posted on 2008-10-10
6
514 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
  • 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

810 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