GridView的RowCommand里取列的值

发布时间:2016-12-11 16:05:33 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"GridView的RowCommand里取列的值",主要涉及到GridView的RowCommand里取列的值方面的内容,对于GridView的RowCommand里取列的值感兴趣的同学可以参考一下。

 protected void gvET_AdminLevel_RowCommand(object sender, GridViewCommandEventArgs e)    {        GridViewRow gvRow = ((GridViewRow)(((ImageButton)(e.CommandSource)).Parent.Parent));         int iAdminLevelID = 0;        ETHaiNan.BLL.ET_AdminLevel bAdminLevel = new ETHaiNan.BLL.ET_AdminLevel();        if (e.CommandName == "Modify")        {            iAdminLevelID = int.Parse(gvET_AdminLevel.Rows[gvRow.RowIndex].Cells[0].Text.ToString());            string strAL_Name = ((TextBox)gvET_AdminLevel.Rows[gvRow.RowIndex].Cells[0].FindControl("txtName")).Text.Trim();            string strDescription = ((TextBox)gvET_AdminLevel.Rows[gvRow.RowIndex].Cells[0].FindControl("txtDescription")).Text.Trim();            string strVersion = ((TextBox)gvET_AdminLevel.Rows[gvRow.RowIndex].Cells[0].FindControl("txtVersion")).Text.Trim();            if (strAL_Name == "")            {                ETHaiNan.Common.JScript.WriteMessage("等级名称不能为空!", true, true);            }            if (strDescription== "")            {                ETHaiNan.Common.JScript.WriteMessage("等级说明不能为空!", true, true);            }            if (strVersion == "")            {                ETHaiNan.Common.JScript.WriteMessage("版本不能为空!", true, true);            }            ETHaiNan.Model.ET_AdminLevel mAdminLevel = new ETHaiNan.Model.ET_AdminLevel();             mAdminLevel.AdminLevelID = iAdminLevelID;            mAdminLevel.AL_Name = strAL_Name;            mAdminLevel.AL_Description = strDescription;             bAdminLevel.Update(mAdminLevel);             ETHaiNan.Common.JScript.AlertAndRedirect("修改成功!","managerAdminLevel.aspx");        }        if (e.CommandName == "Del")        {            //Response.Write(e.CommandArgument.ToString());            iAdminLevelID = int.Parse(e.CommandArgument.ToString());            bAdminLevel.Delete(iAdminLevelID);             ETHaiNan.Common.JScript.AlertAndRedirect("删除成功!", "managerAdminLevel.aspx");        }        //bindData();    }

上一篇:POJ 2479 Maximum sum (DP&双最大子段和)
下一篇:ASP.NET 2.0的 GridView中模板列绑定DropDownList的数据处理

相关文章

相关评论