• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# WebControls.DataGridCommandEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.UI.WebControls.DataGridCommandEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DataGridCommandEventArgs类的具体用法?C# DataGridCommandEventArgs怎么用?C# DataGridCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DataGridCommandEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了DataGridCommandEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: grdPriorities_ItemCommand

 /// <summary>
 /// Handles the ItemCommand event of the grdPriorities control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Web.UI.WebControls.DataGridCommandEventArgs"/> instance containing the event data.</param>
 protected void grdPriorities_ItemCommand(object sender, DataGridCommandEventArgs e)
 {
     Priority p;
     var itemIndex = e.Item.ItemIndex;
     switch (e.CommandName)
     {
         case "up":
             //move row up
             if (itemIndex == 0)
                 return;
             p = PriorityManager.GetById(Convert.ToInt32(grdPriorities.DataKeys[e.Item.ItemIndex]));
             p.SortOrder -= 1;
             PriorityManager.SaveOrUpdate(p);
             break;
         case "down":
             //move row down
             if (itemIndex == grdPriorities.Items.Count - 1)
                 return;
             p = PriorityManager.GetById(Convert.ToInt32(grdPriorities.DataKeys[e.Item.ItemIndex]));
             p.SortOrder += 1;
             PriorityManager.SaveOrUpdate(p);
             break;
     }
     BindPriorities();
 }
开发者ID:ChuckLafferty,项目名称:bugnet,代码行数:30,代码来源:ProjectPriorities.ascx.cs


示例2: GridView1_EditCommand

 protected void GridView1_EditCommand(object source, DataGridCommandEventArgs e)
 {
     this.GridView1.EditItemIndex = e.Item.DataSetIndex;
     InitiData();
     DL.InitGroupDrgList((DropDownList)this.GridView1.Items[e.Item.ItemIndex].Cells[3].FindControl("drgDept"), Session["ORGID"].ToString());
     ((CheckBox)this.GridView1.Items[e.Item.ItemIndex].Cells[4].FindControl("chkAll")).Checked = ((Label)e.Item.Cells[12].FindControl("lblAll")).Text == "1" ? true : false;
 }
开发者ID:inspire88,项目名称:TcportGroupOA,代码行数:7,代码来源:SendDoc_Flag.aspx.cs


示例3: GridView1_ItemCommand

 protected void GridView1_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandName == "DEL")
     {
         int intFlag = CSSD.Delete(((Label)e.Item.FindControl("lbl_ID")).Text);
         if (intFlag < 1)
         {
             CallJsFun("alert('由于网络原因,本次删除失败,请联系信息中心技术支持人员!');");
             return;
         }
         CallJsFun("alert('删除成功!');");
         this.IntiData();
     }
     if (e.CommandName == "SUBMIT")
     {
         bool IsPause = ((Label)e.Item.FindControl("lbl_Status")).Text == "4" ? true : false;
         int flag = CSSD.Submit("Caw_CompanyServerShip_Add.aspx", ((Label)e.Item.FindControl("lbl_ID")).Text, Session["UserID"].ToString(), Session["RealName"].ToString(), Session["ORGID"].ToString(), Session["CompanyName"].ToString(), "1", IsPause);
         if (flag < 1)
         {
             CallJsFun("alert('由于网络原因,本次提交失败,请联系信息中心技术支持人员!');");
             return;
         }
         CallJsFun("alert('成功提交');window.close();");
         this.IntiData();
     }
 }
开发者ID:inspire88,项目名称:TcportGroupOA,代码行数:26,代码来源:Caw_CompanyServerShip.aspx.cs


示例4: grdStatus_ItemCommand

 /// <summary>
 /// Handles the ItemCommand event of the grdStatus control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Web.UI.WebControls.DataGridCommandEventArgs"/> instance containing the event data.</param>
 protected void grdStatus_ItemCommand(object sender, DataGridCommandEventArgs e)
 {
     Status s;
     var itemIndex = e.Item.ItemIndex;
     switch (e.CommandName)
     {
         case "up":
             //move row up
             if (itemIndex == 0)
                 return;
             s = StatusManager.GetById(Convert.ToInt32(grdStatus.DataKeys[e.Item.ItemIndex]));
             s.SortOrder -= 1;
             StatusManager.SaveOrUpdate(s);
             break;
         case "down":
             //move row down
             if (itemIndex == grdStatus.Items.Count - 1)
                 return;
             s = StatusManager.GetById(Convert.ToInt32(grdStatus.DataKeys[e.Item.ItemIndex]));
             s.SortOrder += 1;
             StatusManager.SaveOrUpdate(s);
             break;
     }
     BindStatus();
 }
开发者ID:ChuckLafferty,项目名称:bugnet,代码行数:30,代码来源:ProjectStatus.ascx.cs


示例5: grdLanguage_ItemCommand

 protected void grdLanguage_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     string strCA = e.CommandArgument.ToString();
     switch (e.CommandName)
     {
         case "Edit":
             Insert = false;
             Id = strCA;
             List<Data.Language> listE = LanguageService.Language_GetById(Id);
             txtName.Text = listE[0].Name;
             txtFolder.Text = listE[0].Folder;
             chkDefault.Checked = listE[0].Default == "1" || listE[0].Default == "True";
             txtImage.Text = listE[0].Image;
             imgImage.ImageUrl = listE[0].Image.Length > 0 ? listE[0].Image : "";
             chkActive.Checked = listE[0].Active == "1" || listE[0].Active == "True";
             pnView.Visible = false;
             pnUpdate.Visible = true;
             break;
         case "Active":
             string strA = "";
             string str = e.Item.Cells[2].Text;
             strA = str == "1" ? "0" : "1";
             SqlDataProvider sql = new SqlDataProvider();
             sql.ExecuteNonQuery("Update Language set Active=" + strA + "  Where Id='" + strCA + "'");
             BindGrid();
             break;
         case "Delete":
             LanguageService.Language_Delete(strCA);
             BindGrid();
             break;
     }
 }
开发者ID:HoangNgocThin,项目名称:thietbimoitruong,代码行数:32,代码来源:Language.aspx.cs


示例6: LoanListDataGrid_ItemCommand

        protected void LoanListDataGrid_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            string id = string.Empty;
            if (e.CommandName == "LoanImageDelete")
            {
                int selectindex = e.Item.ItemIndex;
                id = this.LoanListDataGrid.Items[selectindex].Cells[0].Text;
            }
            // Response.Write("<script> if(confirm('是否删除')) document.getElementById('HidderField2').value='1';</script>");

            if (!string.IsNullOrEmpty(id) && this.deleteflag == true)
            {
                int iSuccess = LoanMethods.DeleteLoanById(Convert.ToInt32(id));
                if (iSuccess > 0)
                {
                    Alert.Show(this, "删除成功!");
                }
                else
                {
                    Alert.Show(this, "删除失败!");
                }
                if (queryList == null)
                {
                    queryList = new List<QueryElement>();
                }
                BindLoanListDataGrid(queryList);
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "HideORShowColumn();", true);
            }
        }
开发者ID:carriercomm,项目名称:BillingSystem,代码行数:29,代码来源:Loan.aspx.cs


示例7: dgResellers_DeleteCommand

        private void dgResellers_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            int id = int.Parse(e.CommandArgument.ToString());
            CManage.DeleteReseller(id);

            BindDGResellers();
        }
开发者ID:0anion0,项目名称:IBN,代码行数:7,代码来源:Resellers.ascx.cs


示例8: GridView1_UpdateCommand

        protected void GridView1_UpdateCommand(object source, DataGridCommandEventArgs e)
        {
            TextBox txtName = (TextBox)GridView1.Items[e.Item.ItemIndex].FindControl("txtTypeName");
            TextBox txtNote = (TextBox)GridView1.Items[e.Item.ItemIndex].FindControl("txtTypeNote");

            if (txtName.Text.Trim() == "")
            {
                ShowJsMessage("�������Ʊ�����д��");
                return;
            }

            string TypeGuid = GridView1.DataKeys[e.Item.ItemIndex].ToString();
            //�ж��Ƿ���ڣ�ֻ�в����ڲ��ܸ���
            if (!AM.IsAssetsTypeExists(txtName.Text.Trim(), TypeGuid))
            {
                AM.UpdateAssetsType(TypeGuid, txtName.Text.Trim(), txtNote.Text.Trim());

            }
            else
            {
                ShowJsMessage("�����������Ѿ����ڣ���ʹ���������ƣ�");
                return;
            }

            GridView1.EditItemIndex = -1;
            this.Refresh();
        }
开发者ID:inspire88,项目名称:TcportGroupOA,代码行数:27,代码来源:AssetsType_List.aspx.cs


示例9: Grid_CartCommand

 protected void Grid_CartCommand(Object sender, DataGridCommandEventArgs e)
 {
     if(e.CommandName == "Edit")
     {
         ((AdminUsers)Parent).EditUser(userList.User[e.Item.ItemIndex].login);
     }
 }
开发者ID:dineshkummarc,项目名称:DotNetPortalSrc-102,代码行数:7,代码来源:UserList.ascx.cs


示例10: DataGrid1_ItemCommand

        protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            DataTable dt1 = new DataTable();
            if (e.CommandName == "select")
            {
                TableRow a = new TableRow();
                a = e.Item;
                dt1 = gcgl.dhx_query(a.Cells[1].Text);
                if (dt1.Rows.Count > 0)
                {
                    DataRow dr = dt1.Rows[0];
                    Session["id"] = a.Cells[1].Text;
                    this.qsmc.Text = dr["倒虹吸名称"].ToString();
                    this.dlwz.Text = dr["所属渠道"].ToString();
                    this.gclx.Text = dr["起始桩号"].ToString();
                    this.sqsy.Text = dr["倒虹吸长度(米)"].ToString();
                    this.qsll.Text = dr["设计流量(立方米/秒)"].ToString();
                    this.qszc.Text = dr["布置型式"].ToString();
                    this.gj.Text = dr["管径(米)"].ToString();
                    this.cz.Text = dr["材质"].ToString();
                    this.lx.Text = dr["断面类型"].ToString();
                    this.dc.Text = dr["洞长(米)"].ToString();
                    this.dg.Text = dr["洞高(米)"].ToString();
                    this.dk.Text = dr["洞宽(米)"].ToString();
                    this.bj.Text = dr["半径(米)"].ToString();
                    this.xc.Text = dr["吸差(米)"].ToString();
                    this.gldw.Text = dr["管理单位"].ToString();
                    this.jssj.Text = dr["建设时间"].ToString();
                    this.yxzk.Text = dr["运行状况"].ToString();
                    this.bzsm.Text = dr["备注说明"].ToString();
                }

            }
        }
开发者ID:hkiaipc,项目名称:yh,代码行数:34,代码来源:dhxxx.aspx.cs


示例11: dgExamProj_ItemCommand

        //生成事件时
        protected void dgExamProj_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            string strArgument = e.CommandArgument.ToString();
            if (e.CommandName == "delete")
            {
                string id = e.CommandArgument.ToString();
                QPS.NEW.BLL.Enterprise ep = new QPS.NEW.BLL.Enterprise();
                try
                {
                    ep.DeleteById(Convert.ToInt32(id));
                    Bind();
                }
                catch (Exception ex)
                { }

            }

            if (e.CommandName == "LinkTo")
            {
                //Label lab = ((Label)e.Item.FindControl("lblPack"));
                Response.Redirect("RoomUpdate.aspx?id=" + e.CommandArgument.ToString());
            }
            if (e.CommandName == "Ifchecked")
            {
                string[] Argument = strArgument.Split('|');
                string id = Argument[0].ToString();
                string examine = Argument[1].ToString();
                NEW.BLL.Enterprise ep = new QPS.NEW.BLL.Enterprise();
                ep.UpdateChecked(id, examine);
                Bind();

            }

        }
开发者ID:lincoln56,项目名称:robinerp,代码行数:35,代码来源:Qyhy.aspx.cs


示例12: EditUser

        protected void EditUser(object source, DataGridCommandEventArgs e)
        {
            var id = EntitiesGrid.DataKeys[e.Item.ItemIndex];
            var url = ResolveUrl("../User/AddUser.aspx?code=" + id);

            Response.Redirect(url);
        }
开发者ID:TalAcademic,项目名称:FinalProject,代码行数:7,代码来源:SearchUser.aspx.cs


示例13: DeleteUser

        protected void DeleteUser(object source, DataGridCommandEventArgs e)
        {
            var id = EntitiesGrid.DataKeys[e.Item.ItemIndex];
            PersonEdit.Instance.Delete((int)id);

            GetByFilter();
        }
开发者ID:TalAcademic,项目名称:FinalProject,代码行数:7,代码来源:SearchUser.aspx.cs


示例14: grdtbCUSTOMERS_ItemCommand

 protected void grdtbCUSTOMERS_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     string strCA = e.CommandArgument.ToString();
     switch (e.CommandName)
     {
         case "Edit":
             Insert = false;
             Id = strCA;
             List<Data.tbCUSTOMERS> listE = tbCUSTOMERSService.tbCUSTOMERS_GetById(Id);
             txtvpassword.Text = listE[0].vpassword;
             txtvcusname.Text = listE[0].vcusname;
             txtdbirthday.Text = listE[0].dbirthday;
             txtvprovince.Text = listE[0].vprovince;
             txtvaddress.Text = listE[0].vaddress;
             txtvmobile.Text = listE[0].vmobile;
             txtvemail.Text = listE[0].vemail;
             pnView.Visible = false;
             pnUpdate.Visible = true;
             break;
         case "Delete":
             try
             {
                 tbCUSTOMERSService.tbCUSTOMERS_Delete(strCA);
             }
             catch
             {
                 Common.WebMsgBox.Show("Khách hàng đã từng mua hàng không thể xóa");
                 return;
             }
             BindGrid();
             break;
     }
 }
开发者ID:HoangNgocThin,项目名称:thietbimoitruong,代码行数:33,代码来源:Customers.aspx.cs


示例15: DataGrid1_Command

        protected void DataGrid1_Command(object source, DataGridCommandEventArgs e)
        {
            string Guid = DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
            if (e.CommandName == "Delete")
            {

                new ReportUpload().DeleteReport(Guid);
                ShowJsMessage("删除成功 .");
            }
            else if (e.CommandName == "UpLoad") //上传口岸委
            {
                new ReportUpload().UpdateTableStatus(Guid, "1");
            }
            Refresh();

            //string AssetsGuid = GridView1.DataKeys[e.Item.ItemIndex].ToString();
            //if (!AM.HasAssetsOut(AssetsGuid))
            //{
            //    AM.DeleteAssetsItem(AssetsGuid);
            //    this.Refresh();
            //}
            //else
            //{
            //    ShowJsMessage("有资产外借未处理,不能删除.");
            //}
        }
开发者ID:inspire88,项目名称:TcportGroupOA,代码行数:26,代码来源:ReportInfo_List.aspx.cs


示例16: grdMember_ItemCommand

 protected void grdMember_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     string strCA = e.CommandArgument.ToString();
     switch (e.CommandName)
     {
         case "Edit":
             Insert = false;
             Id = strCA;
             List<Data.Member> listE = MemberService.Member_GetById(Id);
             txtName.Text = listE[0].Name;
             txtEmail.Text = listE[0].Email;
             txtUsername.Text = listE[0].Username;
             txtPassword.Text = "";
             Password = listE[0].Password;
             chkActive.Checked = listE[0].Active == "1" || listE[0].Active == "True";
             LoadGroupMemberDropDownList();
             ddlGroupMember.Text = listE[0].GroupMemberId;
             pnView.Visible = false;
             pnUpdate.Visible = true;
             break;
         case "Active":
             string strA = "";
             string str = e.Item.Cells[2].Text;
             strA = str == "1" ? "0" : "1";
             SqlDataProvider sql = new SqlDataProvider();
             sql.ExecuteNonQuery("Update [Member] set Active=" + strA + "  Where Id='" + strCA + "'");
             BindGrid();
             break;
         case "Delete":
             MemberService.Member_Delete(strCA);
             BindGrid();
             break;
     }
 }
开发者ID:HoangNgocThin,项目名称:thietbimoitruong,代码行数:34,代码来源:Member.aspx.cs


示例17: dgGroupBans_ItemCommand

 protected void dgGroupBans_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     if (e.CommandName == "Unban")
     {
         GroupBan.Delete(Convert.ToInt32(e.CommandArgument));
     }
 }
开发者ID:varlo,项目名称:Unona9,代码行数:7,代码来源:GroupBans.ascx.cs


示例18: DataGrid1_ItemCommand

        protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            DataTable dt1 = new DataTable();
            if (e.CommandName == "select")
            {
                TableRow a = new TableRow();
                a = e.Item;
                dt1 = gcgl.ql_query(a.Cells[1].Text);
                if (dt1.Rows.Count > 0)
                {
                    DataRow dr = dt1.Rows[0];
                    Session["id"] = a.Cells[1].Text;
                    this.ssqd.Text = dr["所属渠道"].ToString();
                    this.qlmc.Text = dr["桥梁名称"].ToString();
                    this.zh.Text = dr["桩号"].ToString();
                    this.qk.Text = dr["桥宽(米)"].ToString();
                    this.qc.Text = dr["桥长(米)"].ToString();
                    this.zkd.Text = dr["总跨度(米)"].ToString();
                    this.ks.Text = dr["孔数(孔)"].ToString();
                    this.dkjk.Text = dr["单孔净宽(米)"].ToString();
                    this.qxjk.Text = dr["桥下净空(米)"].ToString();
                    this.jgxs.Text = dr["结构型式"].ToString();
                    this.gsnl.Text = dr["过水能力(立方米/秒)"].ToString();
                    this.jzcl.Text = dr["建筑材料"].ToString();

                    this.sjhz.Text = dr["设计荷载"].ToString();
                    this.gldw.Text = dr["管理单位"].ToString();
                    this.yxsj.Text = dr["建设时间"].ToString();
                    this.yxzk.Text = dr["运行状况"].ToString();
                    this.bzsm.Text = dr["备注说明"].ToString();
                }

            }
        }
开发者ID:hkiaipc,项目名称:yh,代码行数:34,代码来源:qlxx.aspx.cs


示例19: grdLink_ItemCommand

 protected void grdLink_ItemCommand(object source, DataGridCommandEventArgs e)
 {
     string strCA = e.CommandArgument.ToString();
     switch (e.CommandName)
     {
         case "Edit":
             Insert = false;
             Id = strCA;
             List<Data.Link> listE = LinkService.Link_GetById(Id);
             txtName.Text = listE[0].Name;
             txtLine1.Text = listE[0].Line1;
             txtLine2.Text = listE[0].Line2;
             txtLink1.Text = listE[0].Link1;
             txtLink2.Text = listE[0].Link2;
             txtPosition.Text = listE[0].Position;
             txtOrd.Text = listE[0].Ord;
             chkActive.Checked = listE[0].Active == "1" || listE[0].Active == "True";
             pnView.Visible = false;
             pnUpdate.Visible = true;
             break;
         case "Active":
             string strA = "";
             string str = e.Item.Cells[2].Text;
             strA = str == "1" ? "0" : "1";
             SqlDataProvider sql = new SqlDataProvider();
             sql.ExecuteNonQuery("Update Link set Active=" + strA + "  Where Id='" + strCA + "'");
             BindGrid();
             break;
         case "Delete":
             LinkService.Link_Delete(strCA);
             BindGrid();
             break;
     }
 }
开发者ID:HoangNgocThin,项目名称:thietbimoitruong,代码行数:34,代码来源:Link.aspx.cs


示例20: DataGrid1_ItemCommand

        protected void DataGrid1_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            DataTable dt1 = new DataTable();
            if (e.CommandName == "select")
            {
                TableRow a = new TableRow();
                a = e.Item;
                dt1 = gcgl.csd_query1(a.Cells[1].Text);
                if (dt1.Rows.Count > 0)
                {
                    DataRow dr = dt1.Rows[0];
                    Session["id"] = a.Cells[1].Text;
                    this.ssqd.Text = dr["所属渠道"].ToString();
                    this.xz.Text = dr["形状"].ToString();
                    this.csdmc.Text = dr["沉沙池名称"].ToString();
                    this.qszh.Text = dr["起始桩号"].ToString();
                    this.cd.Text = dr["长度(米)"].ToString();
                    this.zdmj.Text = dr["占地面积(平方米)"].ToString();
                    this.sjcskr.Text = dr["设计沉沙库容(立方米)"].ToString();
                    this.xycskr.Text = dr["现有沉沙库容(立方米)"].ToString();
                    this.zyzy.Text = dr["主要作用"].ToString();
                    this.gldw.Text = dr["管理单位"].ToString();
                    this.jssj.Text = dr["建设时间"].ToString();
                    this.yxzk.Text = dr["运行状况"].ToString();
                    this.bzsm.Text = dr["备注说明"].ToString();
                }

            }
        }
开发者ID:hkiaipc,项目名称:yh,代码行数:29,代码来源:csdxx.aspx.cs



注:本文中的System.Web.UI.WebControls.DataGridCommandEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# WebControls.DataGridItem类代码示例发布时间:2022-05-26
下一篇:
C# WebControls.DataGrid类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap