我在 asp.net 的 aspx 页面中有一个 gridview3。我已经用数据源绑定了 gridview
Gridview 有行按钮。在行按钮中单击,即使我已经编写了 cs 代码来制作一页
标签的可见真实并将另一个gridview2与datasour绑定..
我的网格视图事件正在运行并在运行时读取代码,但我的页面标签
可见性没有发生,gridview2 没有通过数据源显示数据
显示数据..请帮助..
protected void GridView3_RowCommand(object sender, GridViewCommandEventArgs e)
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow selectedRow = GridView3.Rows[index];
DateTime frmdt = this.DateRangePicker2.FromDate;
DateTime Tomdt = this.DateRangePicker2.ToDate;
if (e.CommandName == "btnPrvViewp")
{
if (selectedRow.Cells[1].Text == "Indirect Process" && selectedRow.Cells[2].Text == "SAP")
{
this.lbel1.Text = "Productivity Detaisl for the period " + frmdt + " To " + Tomdt;
this.lbel1.Visible = true;
SqlConnection conn = new SqlConnection(str2);
SqlCommand com = new SqlCommand("ViewProductivity", conn);
com.Parameters.Add("@fromDate", SqlDbType.DateTime ).Value = frmdt;
com.Parameters.Add("@ToDate", SqlDbType.DateTime).Value = Tomdt;
conn.Open();
com.CommandType = CommandType.StoredProcedure;
SqlDataReader readerp = com.ExecuteReader();
GridView2.DataSource = readerp;
GridView2.DataBind();
readerp.Close();
}
}
}