473,322 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

DataGrid paging code not working...

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();
}
}
Nov 17 '05 #1
0 828

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ricardo Manuel | last post by:
Hi, I'm using a Datagrid that I fill with a Dataset but when I configure the paging with the Navigation Buttons I can't put them working, I've tried both methods (Next, Previous and Page Numbers)...
0
by: Stephen | last post by:
This is a real brain-teaser and i'd really appreciate it if someone can try and understand what im trying to do and give me a few pointers or ideas to help me work out my problem. Im basically...
3
by: Joseph D. DeJohn | last post by:
I am trying to get pagination working on a datagrid. Can anyone point me to a resource for help on this? I'm not sure if custom paging is the best option or not.
2
by: Hajime Kusakabe | last post by:
Hi. I have created a datagrid (datagrid1) without any columns on a aspx page. Then aspx.vb adds columns from a database. It is somthing like this .... ================================== Dim...
1
by: Maziar Aflatoun | last post by:
Hi, I have a Datagrid with AllowPaing property set so that the two arrows for the next and previous set of rows are showing. This is working fine. Now is there a way to instead of the 2...
5
by: Patrick.O.Ige | last post by:
Hi Guys, I have a datagrid wit editing and updating. But after adding Paging IT WON'T PAGE!! It compiles well but when i click on the paging link it doesn't go to the next link.. When i remove...
2
by: RJN | last post by:
Hi Sorry for posting again. I have a datagrid which is put inside a div tag to make it scrollable. I need to page the datagrid. The page numbers appear at the bottom of the datagrid and has...
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
6
by: coleenholley | last post by:
Hi All :-) I need to populate a table I created as a web form. Are there any links to show me how to do this? I CANNOT use a dtagrid for this, the table has to be laid out as follows: Header...
2
by: getziiiiiiiiiii | last post by:
Hi There. . I need some help in paging (which is not working) in ASP:DATAGRID My Data source id is a function which returns DataTable to this datagrid. Do i need a code behind to get the next...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.