private void InstantiateCustomCommandButton()
{
// Instantiating a CustomCommandButton object
CustomCommandButton button = new CustomCommandButton();
// Setting the command for button
button.Command = "MyButton";
// Setting text of the button
button.Text = "MyButton";
// Setting image URL of the button, should be relative to website root folder
button.ImageUrl = "../Image/aspose.ico";
// Adding button to CustomCommandButtons collection of GridWeb
GridWeb1.CustomCommandButtons.Add(button);
}