我有两个gridview,第二个gridview的数据为固定列和动态添加的模板列,点击第一个linkbutton,第二个值消 20
我有两个gridview并且分别有一个linkbutton,第二个gridview的数据为固定列和动态添加的模板列,当点击第一个linkbutton时,第二个linkbu...
我有两个gridview并且分别有一个linkbutton,第二个gridview的数据为固定列和动态添加的模板列,当点击第一个linkbutton时,第二个linkbutton的数据有时会丢死,不知道如何解决。请高手指教。
private DataTable CreateBaseDataSource()
{
DataTable dt = new DataTable();
DataRow dr;
ds.Clear();
ds = mrp.fillDataSet("select a.id,a.xid,a.item,b.Command_no,a.ChargeMan,b.StartDate from o_orderNoDetail as a,o_OrderNo as b where a.OrderID='" + lblorderid.Text.Trim() + "'and b.id='" + lblorderid.Text.Trim() + "'");
DataTable dt_1 = ds.Tables[0];
dt.Columns.Add(new DataColumn("xid", typeof(Int32)));
dt.Columns.Add(new DataColumn("item", typeof(string)));
dt.Columns.Add(new DataColumn("StartDate", typeof(string)));
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
dr = dt.NewRow();
dr["xid"] = dt_1.Rows[i]["xid"];
dr["item"] = dt_1.Rows[i]["item"];
dr["StartDate"] = dt_1.Rows[i]["StartDate"];
dt.Rows.Add(dr);
}
return dt;
} 展开
private DataTable CreateBaseDataSource()
{
DataTable dt = new DataTable();
DataRow dr;
ds.Clear();
ds = mrp.fillDataSet("select a.id,a.xid,a.item,b.Command_no,a.ChargeMan,b.StartDate from o_orderNoDetail as a,o_OrderNo as b where a.OrderID='" + lblorderid.Text.Trim() + "'and b.id='" + lblorderid.Text.Trim() + "'");
DataTable dt_1 = ds.Tables[0];
dt.Columns.Add(new DataColumn("xid", typeof(Int32)));
dt.Columns.Add(new DataColumn("item", typeof(string)));
dt.Columns.Add(new DataColumn("StartDate", typeof(string)));
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
dr = dt.NewRow();
dr["xid"] = dt_1.Rows[i]["xid"];
dr["item"] = dt_1.Rows[i]["item"];
dr["StartDate"] = dt_1.Rows[i]["StartDate"];
dt.Rows.Add(dr);
}
return dt;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询