bdb12
asked on
Gridview paging
Following on from this question
https://www.experts-exchange.com/questions/23125398/Gridview-enabling-paging-programatically.html?anchorAnswerId=20784223#a20784223
I had another problem.....
The page loads up the gridview, and paging is enabled. Cool but when I click on any pages I get the following error
"The GridView 'grdDisplay' fired event PageIndexChanging which wasn't handled. "
Any ideas??
https://www.experts-exchange.com/questions/23125398/Gridview-enabling-paging-programatically.html?anchorAnswerId=20784223#a20784223
I had another problem.....
The page loads up the gridview, and paging is enabled. Cool but when I click on any pages I get the following error
"The GridView 'grdDisplay' fired event PageIndexChanging which wasn't handled. "
Any ideas??
Dim conn As New SqlConnection("Data Source=DAODEVBOX;Initial Catalog=suds_prototype;User ID=sa;Password=***")
Dim ds As New Data.DataSet()
Dim da As New SqlDataAdapter("select * from Centers", conn)
da.Fill(ds, "Centers")
grdDisplay.DataSource = ds.Tables("Centers")
grdDisplay.AllowPaging = True
grdDisplay.PageSize = 10
grdDisplay.DataBind()
grdDisplay.Visible = True
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Having a few problems, code below
Also cant find CurrentPageIndex or PageIndexChanged functions in intellisense?
Also cant find CurrentPageIndex or PageIndexChanged functions in intellisense?
Dim grdDisplay As DataGrid
Dim hndl As DataGridPageChangedEventHandler
AddHandler grdDisplay_PageIndexChanged, hndl 'error here, underlined AddHandler msg = syntax error
and then
Sub grdDisplay_pageIndexChanged(ByVal s As Object, ByVal e As DataGridPageChangedEventArgs)
grdDisplay.SelectedIndex = e.NewPageIndex
grdDisplay.DataBind()
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok tried
Dim grdDisplay As DataGrid
Dim handlergrd As DataGridPageChangedEventHa ndler
' AddHandler grdDisplay_PageIndexChange d, hndl
AddHandler grdDisplay.PageIndexChange d, AddressOf grdDisplay_pageIndexChange d
Still get the same error
underlined AddHandler, msg = syntax error
Dim grdDisplay As DataGrid
Dim handlergrd As DataGridPageChangedEventHa
' AddHandler grdDisplay_PageIndexChange
AddHandler grdDisplay.PageIndexChange
Still get the same error
underlined AddHandler, msg = syntax error
Open in new window