ASP.NET C# newbie

C

Craig

How do I get the datagrid to page using C# in ASP.NET???

I have always used vb and to make a datagrid page the vb code that works
is..........

Private Sub DataGrid1_PageIndexChanged(ByVal source As Object, ByVal e
As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
DataGrid1.PageIndexChanged

DataGrid1.CurrentPageIndex = e.NewPageIndex
sqlDataAdapter1.Fill(MyDataset)
DataGrid1.DataBind()

End Sub


C# code I entered is BUT DOES NOT WORK. THE EVENT DOES NOT EVEN FIRE IN
DEBUG MODE. WHY?
private void DataGrid1_PageIndexChanged(Object sender,
DataGridPageChangedEventArgs e)
{
// Set CurrentPageIndex to the page the user clicked.
DataGrid1.CurrentPageIndex = e.NewPageIndex;

// Rebind the data to refresh the DataGrid control.
sqlDataAdapter1.Fill(dataSetCSharp1);
Page.DataBind();
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top