views:

31

answers:

2

In my application I have a gridview in which details of containers are stored and displyed.

There are many containers in this gridview, say more than 150 containers. I have implemented paging for this gridview as it contains many record. But its difficult for the user to go to every page and search one particular container. So i want a serach option for this.

What I need is to enter a containernumber in a textbox and when I click a button, it should redirect to that particular page in the gridview where that particular containernumber exists.

What should be done for this? I need the exact code. Please help.

A: 

this will take your gridview to page #4: gridView1.PageIndex = 4

David-79
page number #5 of course (zero indexed)
David-79
A: 

Sorry, I don't have an exact answer for your question... but have a sugession...

Instead of Scrolling the grid view to the position of the container... consider showing the details of container being searched seperately in a popup or page... You can even use details view or Form view to accomplish this.

Edit : Just incase you want to stick to yours.. you may first need to calculate the page in which the particular record might be and then set the pageindex property of the Gridview to that page. (as mentioned by David)

The King