/// <summary>
    /// Executes custom grid actions.
    /// </summary>
    /// <param name="actionName">Name of the action</param>
    /// <param name="actionArgument">Argument for the action</param>
    private void Control_OnAction(string actionName, object actionArgument)
    {
        switch (actionName)
        {
        case "delete":
            if (QueriesCanBeModified)
            {
                QueryInfo     queryInfo = QueryInfoProvider.GetQueryInfo(ValidationHelper.GetInteger(actionArgument, 0));
                DataClassInfo classInfo = ((DataClassInfo)Page.EditedObjectParent);
                if ((queryInfo != null) && (classInfo != null) && (queryInfo.ClassID == classInfo.ClassID))
                {
                    queryInfo.Delete();
                }
                else
                {
                    CMSPage.RedirectToInformation("editedobject.notexists");
                }
            }
            else
            {
                Control.ShowError(ResHelper.GetString("cms.query.customization.deletedisabled"));
            }

            break;
        }
    }