troubleshooting Question

GridView PageIndexChanging

Avatar of asp_net2
asp_net2Flag for United States of America asked on
10 Comments1 Solution2291 ViewsLast Modified:

I have a problem with my PageIndexChanging code. When my page first load i have code that executes on the Page_Load Event that retries data to a dropdown. When I select a value from the dropdown control it populates a GridView. When I try to select a different page within the Paging of the GridView i do not see the results nor do i receive an error.

Please see my code below:

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then

      'Binds data to DropDownList1
  End If
    End Sub

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged

'Binds results from DropDown and displays the values in the GridView

End Sub

Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging
        GridView1.PageIndex = e.NewPageIndex
    End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 10 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros