Aspose.Cells.GridWeb.Examples.CSharp.GridWebBasics.AddRemoveContextMenuItem.btnRemoveContextMenuItem_Click C# (CSharp) Метод

btnRemoveContextMenuItem_Click() защищенный Метод

protected btnRemoveContextMenuItem_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
Результат void
        protected void btnRemoveContextMenuItem_Click(object sender, EventArgs e)
        {
            // ExStart:RemoveContextMenuItem
            if (GridWeb1.CustomCommandButtons.Count > 1)
            {
                // Remove the 2nd custom command button or context menu item using remove at method
                GridWeb1.CustomCommandButtons.RemoveAt(1);
            }

            if (GridWeb1.CustomCommandButtons.Count >= 1)
            {
                // Access the 1st custom command button or context menu item and remove it
                CustomCommandButton custbtn = GridWeb1.CustomCommandButtons[0];
                GridWeb1.CustomCommandButtons.Remove(custbtn);
            }           
            // ExEnd:RemoveContextMenuItem
        }