Solved

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

Posted on 2008-10-10
6
512 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:lsbgfl
Comment Utility
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
Comment Utility
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
Comment Utility
I'm going to try the Ajax timer control.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Azure Web App - See files 3 21
Visual Studio Code with .Net Core 5 15
Converting C# Objects into JSON file 7 36
Showdialog 8 20
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now