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();
}
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();
}