views:

513

answers:

1

Hi, I have an asp.net application in which I am using a grid view. Paging and sorting are applied to the grid view.One action what I am doing is on click of any grid view row, am getting the column values of the selected row and redirecting to the other page.

The problem is after the grid view is sorted,if I click on any of the row in ayy page(paging index),am getting only first page values even though the visible row is different.

I am getting the row values in gridview_rowcreated() method and putting in some variable. In sorting scenario, before sorting is done, the gridview_rowcreated() method is called but not after the sorting is done.

Please help me in this wht to do...asap

Thanks Rupa

A: 

In case you still need an answer to this... You should be using the gridview's SelectedIndexChanging event with something like the following:

gridView.Rows.Item(intNewIndex).Cells(# of column, zero-based).Text

This will give each cell's current value, you'll just have to loop through each cell and assign each cell's value to desired variable(s).

Hope this helps!!!

John Phipps