[英]Detailsview on ModalPopUp only displays first row of gridview
我在modalpopup內部有一個detailsview,該視圖應該在我的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();
}
我找到了解決我問題的方法。 就在我眼前:
protected void gvStudent_SelectedIndexChanged(object sender, EventArgs e)
{
dvstudent.PageIndex = gvStudent.SelectedIndex;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.