0
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            detailview1.PageIndex = GridView1.SelectIndexl;

        }

this show gridview first page data when i go to second page of griedviw detail view show dat which is in first page of griedview not a current dta why?

Edited by __avd: Added [code] tags.

3
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Ramesh S
0

Hi,

GridView.SelectedIndexChanged Event occurs when a row's Select button is clicked, but after the GridView control handles the select operation. GridView.SelectedIndex property returns the zero-based index of the selected row in a GridView control. You are trying to assign the row index to the PageIndex property which is completely wrong.

0

After setting up PageIndex, please rebind the detailsview

In case, if you are using SqlDatasource then

detailview1.PageIndex = GridView1.SelectIndexl;
defailview1.DataBind();
1

Hi Kiran,

Ignore my previous post. I though you assigned the GridView.SelectedIndex to GridView.PageIndex. I didn't see detailview1.PageIndex properly.

Sorry for the inconvenience. Please follow the adatapost reply.

Votes + Comments
Hey pal! No need to say sorry :) OP is unclear.
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.