62,041
社区成员
发帖
与我相关
我的任务
分享
protected void GVUserPower_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowState.ToString().IndexOf("Edit") >= 0)//如果处于编辑状态
{
string UserName = e.Row.Cells[0].Text;
string sql = "select 管理权限 from 权限表 where 用户名='"+UserName+"'";
DataSet ds = opls.GetTable(sql, "权限表");
string manage=ds.Tables[0].Rows[0]["管理权限"].ToString();
DropDownList dlist1 = (DropDownList)e.Row.Cells[2].FindControl("DLManage");
dlist1.Items.FindByText(manage).Selected=true;
}
}
protected void GVUserPower_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowState.ToString().IndexOf("Edit") >= 0)//如果处于编辑状态
{
string UserName = e.Row.Cells[0].Text;
string sql = "select 管理权限 from 权限表 where 用户名='"+UserName+"'";
DataSet ds = opls.GetTable(sql, "权限表");
string manage=ds.Tables[0].Rows[0]["管理权限"].ToString();
Label lblManage = (Label)e.Row.Cells[2].FindControl("lblManage");
lblManage.Text = manage;
DropDownList dlist1 = (DropDownList)e.Row.Cells[2].FindControl("DLManage");
dlist1.Items.FindByText(manage).Selected=true;
}
}
protected void GVUserPower_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowState.ToString().IndexOf("Edit") >= 0)//如果处于编辑状态
{
Label lblManage = (Label)e.Row.Cells[2].FindControl("lblManage");
DropDownList dlist1 = (DropDownList)e.Row.Cells[2].FindControl("DLManage");
dlist1 .Items.FindByText(lblManage.Text).Selected=true;
}
}