DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 09 Aug 2007 17:43:10 +0100,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    DesCF


FormView - Paging   
I have programatically created a DataSet (mdsShippers) that consists of a  single DataTable - the Shippers table from Northwind. I have then added a  FormView control to my WebForm and then two text-boxes in the ItemTemplate  (txShipperID and txtCompanyName).  In order to get the FormView to display  and page through the records properly I have written the sode shown  below.  However, I have arrived at it through experimentation without  really knowing what I am doing.  My question is, am I doing what I am  doing right ?


   Protected Sub Page_Load(ByVal sender As Object, ByVal e As  System.EventArgs) Handles Me.Load

     If Not Page.IsPostBack Then
       bdl_LoadShips() ' Creates DataSet and populates DataTable
     Else
       Me.mdsShippers = Session("Shippers")
     End If

     With Me.fvShippers
       .DataSource = Me.mdsShippers.Tables("dtShippersLIST")
       .DataBind()
     End With

   End Sub

   Protected Sub fvShippers_PageIndexChanging(ByVal sender As Object, ByVal  e As System.Web.UI.WebControls.FormViewPageEventArgs) Handles  fvShippers.PageIndexChanging

     Me.fvShippers.PageIndex = e.NewPageIndex
     Me.fvShippers.DataBind()

   End Sub

   Protected Sub Page_Unload(ByVal sender As Object, ByVal e As  System.EventArgs) Handles Me.Unload

     Session("Shippers") = Me.mdsShippers

   End Sub


--








-- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Date:Thu, 09 Aug 2007 17:43:10 +0100   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us