asp.net 编辑gridview的小例子

家电修理 2023-07-16 19:17www.caominkang.com电器维修

编辑gridvie例子,完整代码如下。
复制代码 代码如下:
protected void GridVie1_RoEditing(object sender, GridVieEditEventArgs e)
     {
         GridVie1.EditIndex = e.NeEditIndex;
         BingGrid();
     }
     protected void GridVie1_RoCancelingEdit(object sender, GridVieCancelEditEventArgs e)
     {
         GridVie1.EditIndex = -1;
         BingGrid();
     }
     protected void GridVie1_RoUpdating(object sender, GridVieUpdateEventArgs e)
     {
         try
         {
             GridVieRo ro = GridVie1.Ros[e.RoIndex];
             string TXB_FORUMNAME = ((TextBox)ro.FindControl("TXB_FORUMNAME")).Text.Trim().ToString();
             int TXB_ROOTFORUMID = Convert.ToInt16(((TextBox)ro.FindControl("TXB_ROOTFORUMID")).Text.Trim());
             int TXB_ISDISPLAY = Convert.ToInt16(((TextBox)ro.FindControl("TXB_ISDISPLAY")).Text.Trim());
             string TXB_MASTER = ((TextBox)ro.FindControl("TXB_MASTER")).Text.ToString();
             int TXB_ISLOCK = Convert.ToInt16(((TextBox)ro.FindControl("TXB_ISLOCK")).Text.Trim());
             int LB_FORUMID=Convert.ToInt16(((Label)ro.FindControl("Label6")).Text);
             ForumBLL.Forum_Update_Name(TXB_FORUMNAME, TXB_ISDISPLAY, TXB_ROOTFORUMID, TXB_MASTER, TXB_ISLOCK, LB_FORUMID);
         }
         catch (Exception ex)
         {
             Response.Write(ex);
         }
         GridVie1.EditIndex = -1;
         BingGrid();
     }


GridVie直接编辑,删除经典例子下载

Copyright © 2016-2025 www.caominkang.com 曹敏电脑维修网 版权所有 Power by