当前位置: 首页>>代码示例>>C#>>正文


C# GridCommandEventArgs类代码示例

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


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

示例1: _grdUserUnit_ItemCommand

    protected void _grdUserUnit_ItemCommand(object source, GridCommandEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            string _ID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["ID"].ToString();
            GridDataItem item = e.Item as GridDataItem;
            if (item != null)
            {
                LinkButton button = item["Disable"].Controls[0] as LinkButton;

                if (button.Text == "Enable")
                {
                    if (_rdoUnit.Checked)
                        EnableUnit(_ID);
                }
                else if (button.Text == "Disable")
                {
                    if (_rdoUnit.Checked)
                        DisableUnit(_ID);
                    //else if (_rdoUser.Checked)
                    //DisableUser(_ID);
                }
            }
        }
    }
开发者ID:guarddoggps,项目名称:xtremek-static,代码行数:26,代码来源:UserUnitList.aspx.cs

示例2: ucTourists_onTouristUpdated

 protected void ucTourists_onTouristUpdated(object sender, GridCommandEventArgs e)
 {
     this.lblUpdated.Text = "Updated: " + ((GridEditableItem)e.Item).GetDataKeyValue("PolTuristiSaraksts").ToString();
     var intTouristId = (int)((GridEditableItem)e.Item).GetDataKeyValue("PolTuristiSaraksts");
     var itemTourist = ucTourists.TouristsList.Where(n => n.PolTuristiSaraksts == intTouristId).FirstOrDefault();
     itemTourist.Fransize = itemTourist.PolTuristiSaraksts * 5;
 }
开发者ID:geolabgit,项目名称:lgprep,代码行数:7,代码来源:Default.aspx.cs

示例3: RadGrid1_InsertCommand

 protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
 {
     var item = e.Item as GridEditableItem;
     var values = new Hashtable();
     item.ExtractValues(values);
     BLL.Users.Insert(values);
 }
开发者ID:zgying,项目名称:CRMWeiXin,代码行数:7,代码来源:AddEditUsers.aspx.cs

示例4: RadGrid1_InsertCommand

    protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)
    {
        var editableItem = ((GridEditableItem)e.Item);
        Hashtable values = new Hashtable();
        editableItem.ExtractValues(values);
        try
        {
            var posName = values["PositionName"] as string;

            if (posName == null || string.IsNullOrEmpty(posName.Trim()))
            {
                ShowErrorMessage(Pharma.Please_provide_name_to_add);
                e.Canceled = true;
            }
            else
            {
                var result = repo.Add(posName.Trim());
                if (!result)
                {
                    ShowErrorMessage("Position Name is unique, please choose another name.");
                    e.Canceled = true;
                }
            }
        }
        catch (System.Exception ex)
        {
            ShowErrorMessage(ex.Message);
            e.Canceled = true;
        }
    }
开发者ID:groshugo,项目名称:unitedpharma,代码行数:30,代码来源:SupervisorPositionManagement.aspx.cs

示例5: RadGrid1_OnItemCommand

 protected void RadGrid1_OnItemCommand(object sender, GridCommandEventArgs e)
 {
     try
     {
         GridDataItem item = (GridDataItem)e.Item;
         string id = item["colId"].Text;
         switch (e.CommandName)
         {
             case "btnSelect":
                 {
                    Response.Redirect("DesignationInformation.aspx?id="+id,true);
                     break;
                 }
             case "btnDelete":
                 int del = new Designation().DeleteDesignationByDesignationId(int.Parse(id));
                 if (del == 0)
                     Alert.Show("Data is not deleted");
                 else
                 {
                     this.LoadDesignationTable();
                 }
                 break;
         }
     }
     catch (Exception ex)
     {
         Alert.Show(ex.Message);
     }
 }
开发者ID:omidcc,项目名称:Indenting-DrugLand-Financial,代码行数:29,代码来源:DesignationList.aspx.cs

示例6: BlogGrid_ItemCommand

        protected void BlogGrid_ItemCommand(Object sender, GridCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == "Delete")
                {
                    GridEditableItem item = (GridEditableItem)e.Item;
                    Object id = item.GetDataKeyValue("ID");

                    try
                    {
                        BlogManager.Current.Delete(Convert.ToInt32(id));
                        BlogManager.Current.Save();
                    }
                    finally
                    {
                        BlogManager.Current.Reset();
                    }
                }
            }
            catch (Exception ex)
            {

                SetMessage("Article cannot be deleted. Reason: " + ex.Message);
                e.Canceled = true;
            }
            finally
            {
                BlogGrid.Rebind();
            }
        }
开发者ID:CsbSeminary,项目名称:WebSite,代码行数:31,代码来源:BlogFinder.ascx.cs

示例7: RadGrid1_InsertCommand

 protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
 {
     GridEditableItem item = e.Item as GridEditableItem;
     Hashtable values = new Hashtable();
     item.ExtractValues(values);
     roles.Insert(values);
 }
开发者ID:zgying,项目名称:CRMWeiXin,代码行数:7,代码来源:AddEditRoles.aspx.cs

示例8: grdConference_ItemCommand

        protected void grdConference_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.Item != null)
            {
                string[] commandsToCloseOtherItemsFor = { RadGrid.InitInsertCommandName, RadGrid.EditCommandName };
                if (commandsToCloseOtherItemsFor.Contains(e.CommandName))
                {
                    e.Item.OwnerTableView.IsItemInserted = false;
                    e.Item.OwnerTableView.ClearChildEditItems();
                }

                if (e.CommandName.Equals(RadGrid.ExpandCollapseCommandName))
                {
                    e.Item.OwnerTableView.IsItemInserted = false;
                    e.Item.OwnerTableView.ClearChildEditItems();

                    if (e.Item is GridDataItem)
                    {
                        foreach (GridDataItem item in e.Item.OwnerTableView.Items.OfType<GridDataItem>().Where(it => it != e.Item))
                        {
                            item.Expanded = false;
                        }
                    }
                }

                if (e.CommandName.Equals(RadGrid.RebindGridCommandName))
                {
                    GridTableView table = e.Item.OwnerTableView;
                    table.SortExpressions.Clear();
                    table.Rebind();
                    e.Canceled = true;
                }
            }
        }
开发者ID:TrifectaTech,项目名称:ConferencePlus,代码行数:34,代码来源:BrowseConference.aspx.cs

示例9: MenuGrid_ItemCommand

        protected void MenuGrid_ItemCommand(Object sender, GridCommandEventArgs e)
        {
            try
            {
                GridEditableItem item = (GridEditableItem)e.Item;
                Int32 id = (Int32)item.GetDataKeyValue("ID");

                if (e.CommandName == "Delete")
                {
                    try
                    {
                        if (MenuManager.Current.Delete(id))
                            MenuManager.Current.Save();
                        else
                            ShowMessage("Item cannot be removed: menu contains a child items.");
                    }
                    finally
                    {
                        MenuManager.Current.Reset();
                    }
                }
            }
            catch (Exception ex)
            {

                ShowMessage("Activity cannot be deleted. Reason: " + ex.Message);
                e.Canceled = true;
            }
            finally
            {
                MenuGrid.Rebind();
            }
        }
开发者ID:CsbSeminary,项目名称:WebSite,代码行数:33,代码来源:MenuFinder.ascx.cs

示例10: rgAdminListDepartment_InsertCommand

    protected void rgAdminListDepartment_InsertCommand(object source, GridCommandEventArgs e)
    {
        GridEditableItem dataItem = (GridEditableItem)e.Item;

        int departmentId = 0;

        TextBox txtDepartmentName = (TextBox)dataItem["DepartmentName"].Controls[0];
        TextBox txtDescription = (TextBox)dataItem["Description"].Controls[0];

        if (txtDepartmentName.Text == string.Empty || txtDescription.Text == string.Empty)
        {
            ShowAlertMessage("Please enter the department and description to add!");
        }
        else
        {
            int IsSaved = new AdministrationBAL().InsertDepartment(departmentId, txtDepartmentName.Text, txtDescription.Text);
            if (IsSaved < 0)
                ShowAlertMessage("Entered Department is already exists!");
            else
            {
                ShowAlertMessage("New Department Saved successfully!");
            }
        }
        BindDepartment(false);
    }
开发者ID:hurricanechaser,项目名称:CareerJobs,代码行数:25,代码来源:AdminListDepartment.aspx.cs

示例11: pGrid_ItemCommand

        void pGrid_ItemCommand(object sender, GridCommandEventArgs e)
        {
            Int64 Key = 0;

            // Get the ID for the row to select or delete
            if (e.CommandName.ToUpper() == "SELECT" || e.CommandName.ToUpper() == "DELETE")
            {
                //Key = Methods.Convert_Int64(this.UserGrid.pGrid.MasterTableView.Items[e.Item.ItemIndex].GetDataKeyValue("RecruitmentTestUserID").ToString());
                Key = this.UserGrid.GetKey(e.Item.ItemIndex);
            }

            switch (e.CommandName)
            {
                case "Select":
                    this.Response.Redirect(@"~/Page/User_Details.aspx?ID=" + Key);
                    break;

                case "Delete":
                    ClsKeys ClsKey = new ClsKeys();
                    ClsKey.Add("RecruitmentTestUserID", Convert.ToInt64(Key));

                    this.ClsUser.Load(ClsKey);
                    this.ClsUser.Delete();
                    this.UserGrid.RebindGrid();

                    break;
            }
        }
开发者ID:kolinlocke,项目名称:WebApplication_Exam,代码行数:28,代码来源:User_Org.aspx.cs

示例12: RadGrid1_OnItemCommand

        protected void RadGrid1_OnItemCommand(object sender, GridCommandEventArgs e)
        {
            try
            {

                GridDataItem item = (GridDataItem)e.Item;

                string id = item["colId"].Text;

                switch (e.CommandName)
                {
                    case "btnSelect":
                        Response.Redirect("ChartOfAccounting.aspx?id=" + id, true);
                        break;
                    case "btnDelete":
                        //int delete = new Bank().DeleteBankByBankId(int.Parse(id));
                        int delete = new ChartOfAccount().DeleteChartOfAccountByCoaId(int.Parse(id));

                        if (delete == 0)
                        {
                            Alert.Show("Data was not delete..");
                        }
                        else
                            LoadChartOfAccountTable();
                        break;
                }
            }
            catch (Exception ex)
            {
                Alert.Show(ex.Message);
            }
        }
开发者ID:omidcc,项目名称:Indenting-DrugLand-Financial,代码行数:32,代码来源:ChartOfAccountingInfoList.aspx.cs

示例13: RadGrid1_ItemCommand

        protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == "btntradedetails")
            {
                GridDataItem item = (GridDataItem)e.Item;
                int paymentkey = Convert.ToInt32(item["payments_key"].Text);
                LoadTradeDetails(paymentkey);
                pnltradedetails.Visible = true;
            }
            if (e.CommandName == "btnWithdraw")
            {
                GridDataItem item = (GridDataItem)e.Item;
                int paymentkey = Convert.ToInt32(item["payments_key"].Text);
                Payment paymenttemp = sitetemp.getPayment(paymentkey);
                Int64 payment_payment_object_key = sitetemp.getpaymentobject(6, paymentkey);
                Users user_requestor = sitetemp.get_user_info(paymenttemp.Requestor_user_key);

                sitetemp.InternalTransaction(paymenttemp.Buy_currency, paymenttemp.Buy_amount, payment_payment_object_key, paymenttemp.Payment_object_receiver, currentuser.User_key, "From Payment object to Withdrawl Bank Account", 1, paymentkey);
                Peerfx_DB.SPs.UpdatePaymentStatus(paymentkey, 5).Execute(); //payment delivered

                //payment completed, send email
                Peerfx.External_APIs.SendGrid sg = new Peerfx.External_APIs.SendGrid();
                sg.Send_Email_Payment_Completed(paymenttemp.Payments_Key, user_requestor);

                RadGrid1.Rebind();
            }
        }
开发者ID:Lornestar,项目名称:pfx,代码行数:27,代码来源:Admin_Withdrawl.aspx.cs

示例14: rGridAddress_DeleteCommand

 /// <summary>
 /// rGridAddress_DeleteCommand - Is executed if the 'Delete' command is called
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void rGridAddress_DeleteCommand(object sender, GridCommandEventArgs e)
 {
     GridEditableItem eeditedItem = e.Item as GridEditableItem;
     sp_Sample_Address_Select_DM cSampleAddress = new sp_Sample_Address_Select_DM();
     cSampleAddress.AddrID = Convert.ToInt32(eeditedItem.OwnerTableView.DataKeyValues[eeditedItem.ItemIndex]["AddrID"]);
     BLL.DeleteSampleAddressContext(cSampleAddress);
 }
开发者ID:CISC181,项目名称:VolTeerNET,代码行数:12,代码来源:SampleAddressContext.aspx.cs

示例15: grid_OnDeleteCommand

 protected void grid_OnDeleteCommand(object sender, GridCommandEventArgs e)
 {
     try
     {
         var item = (e.Item as GridEditableItem);
     // ReSharper disable PossibleNullReferenceException
         var roleId = Guid.Parse(item.GetDataKeyValue("RoleId").ToString());
     // ReSharper restore PossibleNullReferenceException
         var userId = Guid.Parse(item.GetDataKeyValue("UserId").ToString());
         var ur = new UserRole
         {
             UserId = userId,
             RoleId = roleId,
             State = State.删除
         };
         HomoryContext.Value.UserRole.AddOrUpdate(ur);
         HomoryContext.Value.SaveChanges();
         LogOp(OperationType.删除);
         grid.Rebind();
         Notify(panel, "操作成功", "success");
     }
     // ReSharper disable EmptyGeneralCatchClause
     catch
     // ReSharper restore EmptyGeneralCatchClause
     {
     }
 }
开发者ID:Homory-Temp,项目名称:LeYi,代码行数:27,代码来源:Authorize.aspx.cs


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