I am facing problem in gridview paging . i am doing like this
using vb.net as code behind file in asp.net
Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging
GridView1.PageIndex = e.NewPageIndex
GridView1.DataBind()
End Sub
PageSize="6" OnPageIndexChanging="GridView1_PageIndexChanging" >

Mayur GujrathiPosted Apr 9, 2011, 8:25 AM
finally i solved it
in this way
I took my dataset in view state
ViewState("dsdata") = ds
then on page index changing i did
myds = DirectCast(ViewState("dsdata"), DataSet)
Dim dataView As New DataView(myds.Tables(0))
GridView1.DataSource = dataView
GridView1.PageIndex = e.NewPageIndex
GridView1.DataBind()
dataView = Nothing
Mayur GujrathiPosted Apr 9, 2011, 4:37 AM
Suthish NairPosted Apr 9, 2011, 4:14 AM
Mayur GujrathiPosted Apr 9, 2011, 3:04 AM
I just see article posted by you "sorting_paging without cahing,viewstate" , i did same changes in my application, but my problem is that i am sending 2 parameters to stored procedure on button click and when i did
Dim dataView As New DataView(ds.Tables(0))
GridView1.DataSource = dataView
GridView1.PageIndex = e.NewPageIndex
GridView1.DataBind()
dataView = Nothing
on page index changing it says table 0 not found because i think it is not getting parameter, what might be solution
on button click i am doing like this
Dim cmd = New SqlCommand
Dim constr = ConfigurationManager.AppSettings("PooledConnectionString")
Dim sqlcon As SqlConnection = New SqlConnection(constr)
Dim da As SqlDataAdapter = New SqlDataAdapter("select * from dp_acct_mstr ", sqlcon)
da.SelectCommand = cmd
cmd.Connection = sqlcon
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "PR_SELECT_CLIENT_TARRIFF"
Dim todate As Date
Dim fromdate As Date
fromdate = ClsDate.GetFormatedDate(hdFromDate.Value, "DD/MM/YYYY")
todate = ClsDate.GetFormatedDate(hdTodate.Value, "DD/MM/YYYY")
cmd.Parameters.AddWithValue("@PA_FROM_DT", fromdate)
cmd.Parameters.AddWithValue("@PA_TO_DT", todate)
da.Fill(ds, "PR_SELECT_CLIENT_TARRIFF")
If (Not (ds.Tables(0).Rows.Count > 0)) Then
Label1.Visible = True
Label1.Text = "No Records Found From Selected Date"
txtfromdt.Value = fromdate
txttodt.Value = todate
ElseIf ds.Tables(0).Rows.Count > 0 Then
Dim rowcount As Integer
rowcount = ds.Tables(0).Rows.Count
Label1.Visible = True '" & rowcount & "
Label1.Text = "Records Found, " & rowcount & " From selected date."
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
txtfromdt.Value = fromdate
txttodt.Value = todate
End If
and declaring a variable dataset ds in declarations
Suthish NairPosted Apr 9, 2011, 2:00 AM
Mayur GujrathiPosted Apr 9, 2011, 1:46 AM
Mayur GujrathiPosted Apr 8, 2011, 8:18 AM
piyush sardharaPosted Apr 8, 2011, 7:07 AM
Mayur GujrathiPosted Apr 8, 2011, 6:59 AM
piyush sardharaPosted Apr 8, 2011, 6:54 AM
page index changed event and bind gird on that event
kritikaPosted Apr 8, 2011, 6:50 AM
Mayur GujrathiPosted Apr 8, 2011, 6:23 AM
whenever i am clicking on next no. data is not displaying only blank page is displayed
Karthikeyan AnbarasanPosted Apr 8, 2011, 6:18 AM
kritikaPosted Apr 8, 2011, 6:15 AM