ModalPopUp上的Detailsview仅显示gridview的第一行

时间:2013-04-15 09:57:05

标签: c# asp.net ajax gridview modalpopupextender

我在modalpopup中有一个detailview,它应该在我的gridivew中显示所选行,但它只显示我的gridview中的第一行。我做错了什么?谢谢你的帮助。

 protected void gvStudent_SelectedIndexChanged(object sender, EventArgs e)
    {

        this.dvstudent.Visible = true;
        this.dvstudent.DataBind();
        this.UpdatePanelDetailsView1.Update();
        this.modalstudent.Show();


    }
 protected void Selecttomodifystudent_Click(object sender, EventArgs e)
    {
        LinkButton buttonstudent = sender as LinkButton;
        GridViewRow row = (GridViewRow)buttonstudent.NamingContainer;
        this.sqlModifyStudent1.SelectParameters.Clear();
        this.dvstudent.DataBind();
        this.UpdatePanelDetailsView1.Update();
        this.modalstudent.Show();
    }

1 个答案:

答案 0 :(得分:1)

我找到了问题的答案。它就在我眼前:

protected void gvStudent_SelectedIndexChanged(object sender, EventArgs e)
    {
        dvstudent.PageIndex = gvStudent.SelectedIndex;
    }