Exemplo n.º 1
0
        private static ButtonRenderMode ConvertToRenderMode(GridViewCommandButtonType buttonType)
        {
            switch (buttonType)
            {
            case GridViewCommandButtonType.Image:
            case GridViewCommandButtonType.Link:
                return(ButtonRenderMode.Link);

            default:
                return(ButtonRenderMode.Button);
            }
        }
        protected new GridViewCommandColumnButtonControl CreateCommandButtonControl(GridViewCommandColumn column, ColumnCommandButtonType commandItemType, GridViewCommandButtonType buttonType, string text, ImageProperties image, int visibleIndex, bool postponeClick)
        {
            if (!CanCreateCommandButton(commandItemType))
            {
                return(null);
            }

            var isEditingRow = DataProxy.IsNewRowEditing && visibleIndex == -2147483647 || visibleIndex >= 0 && DataProxy.IsRowEditing(visibleIndex);

            var eventArgs = new ASPxGridViewCommandButtonEventArgs(column, commandItemType, text, image, visibleIndex, isEditingRow, buttonType);

            Grid.RaiseCommandButtonInitialize_Internal(eventArgs);

            return(eventArgs.Visible ? new GridViewCommandColumnButtonControl(eventArgs, Grid, GetCommandButtonClickHandlerArgs(commandItemType), postponeClick) : null);
        }
 protected new GridViewCommandColumnButtonControl CreateCommandButtonControl(GridViewCommandColumn column, ColumnCommandButtonType commandItemType, GridViewCommandButtonType buttonType, string text, ImageProperties image, int visibleIndex, bool postponeClick)
 {
     if (!CanCreateCommandButton(commandItemType)) return null;
     
     var isEditingRow = DataProxy.IsNewRowEditing && visibleIndex == -2147483647 || visibleIndex >= 0 && DataProxy.IsRowEditing(visibleIndex);
     
     var eventArgs = new ASPxGridViewCommandButtonEventArgs(column, commandItemType, text, image, visibleIndex, isEditingRow, buttonType);
     
     Grid.RaiseCommandButtonInitialize_Internal(eventArgs);
     
     return eventArgs.Visible ? new GridViewCommandColumnButtonControl(eventArgs, Grid, GetCommandButtonClickHandlerArgs(commandItemType), postponeClick) : null;
 }
 private static void SetImageSettings(ASPxButton button, ASPxSmartGridViewECCommandButtonSettings buttonSettings, GridViewCommandButtonType buttonType)
 {
     switch (buttonType)
     {
         case GridViewCommandButtonType.Link:
             break;
         default:
             button.Image.CopyFrom(buttonSettings.Image);
             break;
     }
 }
 private static string GetToolTipText(ASPxSmartGridViewECCommandButtonSettings buttonSettings, GridViewCommandButtonType buttonType, string defaultToolTip)
 {
     switch (buttonType)
     {
         case GridViewCommandButtonType.Image:
             return GetValueOrDefault(buttonSettings.Text, defaultToolTip);
         default:
             return string.Empty;
     }
 }
        private static string GetButtonText(ASPxSmartGridViewECCommandButtonSettings buttonSettings, GridViewCommandButtonType buttonType, string defaultText)
        {
            var buttonText = GetValueOrDefault(buttonSettings.Text, defaultText);

            switch (buttonType)
            {
                case GridViewCommandButtonType.Image:
                    return buttonSettings.Image.IsEmpty ? buttonText : string.Empty;
                default:
                    return buttonText;
            }
        }
 private static ButtonRenderMode ConvertToRenderMode(GridViewCommandButtonType buttonType)
 {
     switch (buttonType)
     {
         case GridViewCommandButtonType.Image:
         case GridViewCommandButtonType.Link:
             return ButtonRenderMode.Link;
         default:
             return ButtonRenderMode.Button;
     }
 }
 private static GridViewCommandButtonType GetButtonType(ASPxSmartGridViewECCommandButtonSettings buttonSettings, GridViewCommandButtonType columnButtonType)
 {
     if (buttonSettings.ButtonType != GridViewCommandButtonType.Default)
         return buttonSettings.ButtonType;
     
     if (columnButtonType != GridViewCommandButtonType.Default)
         return columnButtonType;
     
     return GridViewCommandButtonType.Link;
 }
Exemplo n.º 9
0
        private static void SetImageSettings(ASPxButton button, ASPxSmartGridViewECCommandButtonSettings buttonSettings, GridViewCommandButtonType buttonType)
        {
            switch (buttonType)
            {
            case GridViewCommandButtonType.Link:
                break;

            default:
                button.Image.CopyFrom(buttonSettings.Image);
                break;
            }
        }
Exemplo n.º 10
0
        private static string GetToolTipText(ASPxSmartGridViewECCommandButtonSettings buttonSettings, GridViewCommandButtonType buttonType, string defaultToolTip)
        {
            switch (buttonType)
            {
            case GridViewCommandButtonType.Image:
                return(GetValueOrDefault(buttonSettings.Text, defaultToolTip));

            default:
                return(string.Empty);
            }
        }
Exemplo n.º 11
0
        private static string GetButtonText(ASPxSmartGridViewECCommandButtonSettings buttonSettings, GridViewCommandButtonType buttonType, string defaultText)
        {
            var buttonText = GetValueOrDefault(buttonSettings.Text, defaultText);

            switch (buttonType)
            {
            case GridViewCommandButtonType.Image:
                return(buttonSettings.Image.IsEmpty ? buttonText : string.Empty);

            default:
                return(buttonText);
            }
        }
Exemplo n.º 12
0
        private static GridViewCommandButtonType GetButtonType(ASPxSmartGridViewECCommandButtonSettings buttonSettings, GridViewCommandButtonType columnButtonType)
        {
            if (buttonSettings.ButtonType != GridViewCommandButtonType.Default)
            {
                return(buttonSettings.ButtonType);
            }

            if (columnButtonType != GridViewCommandButtonType.Default)
            {
                return(columnButtonType);
            }

            return(GridViewCommandButtonType.Link);
        }