我有 2 个网格视图。第一个 gridview 存储员工在一个月内工作的总天数,第二个 gridview 存储员工每天工作的总小时数。我在第一个 gridview 中有选择按钮。单击该选择按钮时,该特定行的详细信息应显示在第二个网格视图中。但单击选择按钮后,第二个网格视图不可见。我怎么能做到这一点。代码如下。
protected void gvWorkedDays_SelectedIndexChanged(object sender, EventArgs e)
{
string someVaribaleName = gvWorkedDays.SelectedRow.Cells[1].Text;
TextBox tb = new TextBox();
tb.Text = someVaribaleName;
dTabPrt = dTable2;
dTable2 = getConn.GetAdapterDatatable("SELECT tsNo, tsDate, tsOnSite, tsUser, (Select cmName from customermaster where cmCode=tsCustomer), tsCategory, tsDescription, tsFromTime, tsToTime, tsHours, tsExp, (select tmName from taskmaster where tmCode=tsTask), tsStatus, (Select pmName from project where pmCode=tsProject) from timesheet where tsUser='" + tb.Text + "' and tsDate >= '" + cFDate + "' AND tsdate <= '" + cTDate + "' GROUP BY tsDate", Global.conStrDatabase);
gvDetails.DataSource = dTable2;
gvDetails.DataBind();
gvDetails.AutoGenerateColumns = true;
}
我已将第一个 gridview 的 AutoGenerateSelectButton 属性设置为 true