Click here to Skip to main content
12,749,392 members (32,203 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi Everyone,

I want to implement the slide show in c# .net with grid view control.

Right now I m fetching the data from the database and bind in the Gridview with the page size=1 and then giving the paging to display next.

Now i want to do same thing but no with the paging but after 10sec. the next record will be display automatically like the slide show. and at the last record it will again start from 1st record.

If anyone have an answer please send back to me
Posted 6-Nov-12 22:07pm
saud_a_k 7-Nov-12 4:07am
Side show .. Reminds me of Spy Game
The PageIndexChanging event should help
Rate this: bad
Please Sign up or sign in to vote.

Solution 1


See my article if could help you.

An Outlook menu with "peekaboo" faded in slide show

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

In the front end place the following code:

<asp:timer id="Timer1" runat="server" interval="3000" xmlns:asp="#unknown">

<asp:updatepanel id="Panel1" runat="server" xmlns:asp="#unknown">
<asp:asyncpostbacktrigger controlid="Timer1" eventname="Tick" />

<asp:gridview id="gvAnnouncements" runat="server" autogeneratecolumns="False" pagesize="1">
AllowPaging="True" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None"
BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical" Width="100%">
<pagersettings position="Bottom" lang="HTML">="NextPrevious" PreviousPageImageUrl="images/bullet_left.png"
NextPageImageUrl="images/bullet_right.png" />
<rowstyle backcolor="#F7F7DE" />
<asp:boundfield datafield="Announcements" headertext="Announcements" />

<footerstyle backcolor="#CCCC99" />
<pagerstyle backcolor="#F7F7DE" forecolor="Black" horizontalalign="Right" />
<selectedrowstyle backcolor="#CE5D5A" font-bold="True" forecolor="White" />
<headerstyle backcolor="#627B98" font-bold="True" forecolor="White" horizontalalign="Left">
Font-Size="14px" />
<alternatingrowstyle backcolor="White" />

In the back end code paste the below code

Protected Sub Timer1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Load
If gvAnnouncements.PageCount <> 0 Then
If gvAnnouncements.PageIndex <> gvAnnouncements.PageCount - 1 Then
gvAnnouncements.PageIndex = DirectCast(gvAnnouncements.PageIndex, Integer) + 1
gvAnnouncements.PageIndex = 0
End If
End If
End Sub

Private Sub LoadAnnouncements()
Dim cmd As New OleDbCommand
cmd.CommandText = "select * from announcements order by ID desc"
Dim dt As DataTable = dblayer.LoadData(cmd)

gvAnnouncements.DataSource = dt
End Sub

Protected Sub gvAnnouncements_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles gvAnnouncements.PageIndexChanging

gvAnnouncements.PageIndex = e.NewPageIndex

End Sub

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170215.1 | Last Updated 21 Jun 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100