示例#1
0
        private void ApplyStyle()
        {
            if (this.CommandRenderMode == SortingCommandRenderMode.Button)
            {
                if (_commandStyle != null)
                {
                    _btnAdd.ApplyStyle(CommandStyle);
                    _btnDelete.ApplyStyle(CommandStyle);
                    _btnUp.ApplyStyle(CommandStyle);
                    _btnDown.ApplyStyle(CommandStyle);
                    _btnClear.ApplyStyle(CommandStyle);
                    _btnOK.ApplyStyle(CommandStyle);
                }
            }
            else if (this.CommandRenderMode == SortingCommandRenderMode.ImageButton)
            {
                _imgBtnAdd.ApplyStyle(CommandStyle);
                _imgBtnDelete.ApplyStyle(CommandStyle);
                _imgBtnUp.ApplyStyle(CommandStyle);
                _imgBtnDown.ApplyStyle(CommandStyle);
                _imgBtnOK.ApplyStyle(CommandStyle);
            }

            if (this.SetSortingFieldsRenderMode == SortingSetSortingFieldsRenderMode.ListBox)
            {
                _lstBoxSetSortingFields.ApplyStyle(SetSortingFieldsStyle);
            }
            else if (this.SetSortingFieldsRenderMode == SortingSetSortingFieldsRenderMode.RadioButtonList)
            {
                _rdoBtnLstSetSortingFields.ApplyStyle(SetSortingFieldsStyle);
            }

            if (_sortingFieldsStyle != null)
            {
                _ddlstSortingFields.ApplyStyle(_sortingFieldsStyle);
            }

            if (_sortDirectionStyle != null)
            {
                _rdoBtnLstSortDirection.ApplyStyle(_sortDirectionStyle);
            }
        }
示例#2
0
        private Control CreateButton(string text, string imageUrl)
        {
            Control button;

            if (ButtonType == GridViewColumnButtonType.Link)
            {
                HyperLink link = new HyperLink();
                link.Text        = text;
                link.NavigateUrl = "javascript:void(0)";
                link.ApplyStyle(ControlStyle);

                button = link;
            }
            else if (ButtonType == GridViewColumnButtonType.Image)
            {
                ImageButton imageButton = new ImageButton();

                imageButton.AlternateText = text;

                if (!string.IsNullOrEmpty(imageUrl))
                {
                    imageButton.ImageUrl = Owner.ResolveClientUrl(imageUrl);
                }

                imageButton.ApplyStyle(ControlStyle);

                button = imageButton;
            }
            else
            {
                Button regularButton = new Button();
                regularButton.Text = text;
                regularButton.ApplyStyle(ControlStyle);

                button = regularButton;
            }

            return(button);
        }