日期:2014-05-17 浏览次数:20401 次
if (e.Row.RowType == DataControlRowType.DataRow)//判断是否是数据行
{
DropDownList ddl = (DropDownList)e.Row.FindControl("ddlSalesEmployeeID");
ddl.DataSource = dsSalesEmployeeID;
ddl.DataValueField = "id";
ddl.DataTextField = "UserName";
ddl.DataBind();
DataRowView drv = (DataRowView)e.Row.DataItem;
ddl.SelectedValue = Convert.ToString(drv["UserID"]);
}