我正在使用填充 DetailsViews(主/详细信息方法)的 GridView。当我在 GridView 中单击 Select 并显示 DetailsView 时,在我从 GridView 中选择另一行并显示另一个 DetailsView 后,该视图仍然显示。我的问题是:我怎样才能同时显示一个DetailsView???
到目前为止,我有:
protected void grdMonster_SelectedIndexChanged(object sender, EventArgs e)
{
//grdMonster is GridView and "BookTitle" is datafield and pnlBooks is panel around BookTitle
//DetailsView
if (grdMonster.SelectedValue.ToString() != "BookTitle")
pnlBooks.Visible = false;
else
pnlBooks.Visible = true;
}
它不起作用!BookTitle DetailsView 不显示!}