PC Review


Reply
Thread Tools Rate Thread

DataGrid paging code not working...

 
 
=?Utf-8?B?UiBSZXllcw==?=
Guest
Posts: n/a
 
      27th Sep 2005
I am having a problem with my DataGrid paging correctly...for some reason it
always stays on the same page when I click on the "<" or ">". Can you tell
where I am going wrong in the code? I've taken a good stare at this for
several hours and was hoping someone would notice that little tiny line that
I am not.

Thanks in advance, says the C# noob (me, hehe).

Here's the code:
public partial class EmployeeDirectory : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
getEmployeeDirectory();
}
}
protected void getEmployeeDirectory()
{
using (SqlConnection dbConn = clsDatabase.dbOpen())
{
// Create an SqlDataAdapter object using the SqlConnection object
SqlDataAdapter dbData = new SqlDataAdapter("some SQL statement",
dbConn);

// Create a DataSet object that will be used as a placeholder
for our query data
DataSet dsEmployeeDirectory = new DataSet();
dbData.Fill(dsEmployeeDirectory);

// Bind query data to our DataList object
dgEmployeeDirectory.DataSource = dsEmployeeDirectory;
dgEmployeeDirectory.DataBind();
}
}
protected void dgEmployeeDirectory_PageIndexChanged(object source,
DataGridPageChangedEventArgs e)
{
dgEmployeeDirectory.CurrentPageIndex = e.NewPageIndex;
getEmployeeDirectory();
}
}
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PAGING not working in ASP DataGrid getziiiiiiiiiii Microsoft ASP .NET 2 13th Mar 2007 01:20 AM
Paging in a datagrid not working J. Muenchbourg Microsoft Dot NET 0 26th May 2004 05:17 PM
Datagrid Paging not working Coleen Microsoft ASP .NET 4 31st Dec 2003 10:28 PM
Paging in datagrid not working coleenholley Microsoft VB .NET 0 31st Dec 2003 04:24 PM
DataGrid Paging Sample code Shero Microsoft ADO .NET 2 1st Nov 2003 07:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:05 AM.