Click here to Skip to main content
11,633,998 members (72,796 online)
Rate this: bad
good
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 21:07pm
Comments
saud_a_k at 7-Nov-12 4:07am
   
Side show .. Reminds me of Spy Game
The PageIndexChanging event should help
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,

See my article if could help you.

An Outlook menu with "peekaboo" faded in slide show

Regards,
  Permalink  
Rate this: bad
good
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%">
="NextPrevious" PreviousPageImageUrl="images/bullet_left.png"
NextPageImageUrl="images/bullet_right.png" />


<asp:boundfield datafield="Announcements" headertext="Announcements" />



<selectedrowstyle backcolor="#CE5D5A" font-bold="True" forecolor="White" />
<headerstyle backcolor="#627B98" font-bold="True" forecolor="White" horizontalalign="Left">
Font-Size="14px" />

</headerstyle>





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
Else
gvAnnouncements.PageIndex = 0
End If
LoadAnnouncements()
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
gvAnnouncements.DataBind()
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
LoadAnnouncements()


End Sub
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 8,758
1 Sergey Alexandrovich Kryukov 8,264
2 Mika Wendelius 6,755
3 F-ES Sitecore 2,344
4 Suvendu Shekhar Giri 2,095


Advertise | Privacy | Mobile
Web01 | 2.8.150728.1 | Last Updated 21 Jun 2013
Copyright © CodeProject, 1999-2015
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