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
}