代码页获取对应DataGrid的行的数据
foreach (DataGridItem dgi in dgClass.Items)
CheckBox cb = (CheckBox)dgi.FindControl(“chkbox”);
if (cb.Checked)
LblID.text = dgi.cells[1].Text;
PlanName.Text = dgi.Cells[2].Text;
DropDownList1.SelectedValue = dgi.Cells[3].Text;
DropDownList3.SelectedValue = dgi.Cells[13].Text;
DropDownList4.SelectedValue = dgi.Cells[5].Text;
TxtAdd.Text = dgi.Cells[6].Text;
Txtstime.Text = (dgi.Cells[7].FindControl(“one”) as Label).Text;
Txtetime.Text = (dgi.Cells[8].FindControl(“two”) as Label).Text;
//txtStaffName.Text=dgi.Cells[9].Text;
TxtStaff.Text = dgi.Cells[14].Text;
txtTextBooks.Text = dgi.Cells[15].Text.Trim();
string url = ((HyperLink)(dgi.Cells[16].FindControl(“hlPlanPath”))).NavigateUrl;
lblPlanPath.Text = url.Substring(url.LastIndexOf(“\”) + 1);
DropDownList2.SelectedValue = ((dgi.Cells[8].FindControl(“status”) as Label).Text==”在读”)?”1″:”0″;
break;
评论0