我有2个网格视图。第一个gridview存储一个月内员工的总工作天数,第二个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