Click to See Complete Forum and Search --> : row selection in gridview


mayanksrmcem
01-12-2009, 05:19 AM
hello everybody,

in my aspx page there is a gridview and two asp:button outside of this grid view named "prev" and "next".

as clear by name, on click these buttons, i want two get previous and next row of the grid view,respectively.

have you any idea to solve this problem,
please tell me...

mayanksrmcem
01-13-2009, 05:52 AM
hello everybody,

i have solved my problem of select next-previous row of GridView.
for this, i have write

GridView1.SelectedIndex = 0;

in page load function and

GridView1.SelectedIndex = GridView1.SelectedIndex - 1;

and

GridView1.SelectedIndex = GridView1.SelectedIndex + 1;

in click event of previous and next buttons.

and it is working perfectly.

thanks