protected virtual void CreateCommandButton(GridViewCommandColumnCustomButton button)
        {
            var eventArgs = new ASPxGridViewCustomButtonEventArgs(button, VisibleIndex, CellType, IsRowEditing);

            Grid.RaiseCustomButtonInitialize_Internal(eventArgs);

            switch (eventArgs.Visible)
            {
            case DefaultBoolean.False:
                return;

            case DefaultBoolean.Default:
                if (button._IsVisible(CellType, IsRowEditing))
                {
                    break;
                }

                return;
            }

            CreateCommandButtonSpacerIfNeeded();

            ControlsContainer.Add(
                new GridViewCommandColumnButtonControl(eventArgs, Grid, Scripts.GetCustomButtonFuncArgs, true)
                );
        }
        public T Add <T>(T control) where T : WebControl
        {
            ControlsContainer.Add(control);

            InternalControlsList.Add(control);

            return(control);
        }
        protected virtual void CreateCommandButton(GridViewCommandColumnButtonControl buttonControl)
        {
            if (buttonControl == null)
            {
                return;
            }

            CreateCommandButtonSpacerIfNeeded();

            ControlsContainer.Add(buttonControl);
        }
        public static void CreateButtonInContainer(string text, ControlsContainer container, InnerMethod innerMethod)
        {
            Button newButton = new Button()
            {
                Text = text,
                Size = new Size(30)
            };

            newButton.OnMouseButton += (sender, args) =>
            {
                if (args.IsPressed && args.Button == Duality.Input.MouseButton.Left)
                {
                    innerMethod.Invoke();
                }
            };
            container.Add(new Separator()
            {
                Size = new Size(5)
            });
            container.Add(newButton);
        }
        protected virtual void CreateCommandButtonSpacerIfNeeded()
        {
            if (ControlsContainer.IsNotEmpty)
            {
                var spacing = RenderHelper.GetCommandColumnStyle(Column).Spacing;

                if (spacing.IsEmpty)
                {
                    spacing = GetDefaultCommandColumnSpacing();
                }

                if (spacing.IsEmpty == false)
                {
                    ControlsContainer.Add(
                        new GridViewCommandColumnSpacer(spacing)
                        );
                }
            }
        }