I can sort in gridview,but i've two problem
1)When i click edit button,sorting changed to reverse order.
2)When i go next page through paging,data are not in same order as in previous page.
What can i do ?

Dear Sahoo,
I hope I can help you.

For case no. 2, if you don't mention query to fill data, ASP.Net will retreive data from default ObjectDataSource.selectQuery method.

Protected Sub GVFunding_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GVFunding.PageIndexChanging
Filldata(txtSearch.Text.Trim)
GVFunding.PageIndex = e.NewPageIndex + 1
End Sub

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.