This is a migrated thread and some comments may be shown as answers.

Disable Theming of Controls in FilterCell

1 Answer 174 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Dominik
Top achievements
Rank 1
Dominik asked on 13 Feb 2017, 09:32 AM

Hi, 

 

I have created a custom FilterCell for my Grid with a simple "FilterClear" Button. 

At the beginning of my program, a custom theme gets loaded with changes of the button style. Now i do not want, that my filterclearbuttons looks like the other buttons. I tried to set loRadButtonElement:ElementTree:EnableApplicationThemeName = FALSE. but I get a compile error this way. 

 

I also tried to set these properties of my button in my override CreateChildElements of my CustomFilterCell.

 

      loRadButtonElement:ButtonFillElement:AutoSize = FALSE.
      loRadButtonElement:ButtonFillElement:Size = NEW System.Drawing.Size(16,16).
      loRadButtonElement:ButtonFillElement:Alignment = System.Drawing.ContentAlignment:MiddleCenter.
      loRadButtonElement:BorderElement:AutoSize = FALSE.
      loRadButtonElement:BorderElement:Size = NEW System.Drawing.Size(16,16).
      loRadButtonElement:BorderElement:Alignment = System.Drawing.ContentAlignment:MiddleCenter.

 

I am able to change the style this way but it is not looking as expected. 

i add two images of my current window and how I want it to look like.

 

It would be wonderful, if someone of you could tell me how to obtain the desired style without changing my custom theme

 

Sincerely,

Dominik

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 14 Feb 2017, 02:00 PM
Hi Dominik,

Thank you for writing.

You cannot switch or disable the theme for a single element. You need to set the button styles manually. In this case, you need to move the button initialization to the constructor:
public MyFilterCellElement(GridViewDataColumn column, GridRowElement row) : base(column, row)
{
    button.MinSize = new Size(17, 17);
    button.BorderElement.BackColor = Color.FromArgb(26, 111, 177);
    button.BorderElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
    button.BorderElement.BoxStyle = Telerik.WinControls.BorderBoxStyle.SingleBorder;
    button.Shape = new Telerik.WinControls.RoundRectShape(0);
    button.ButtonFillElement.BackColor = Color.FromArgb(222, 242, 254);
    button.ButtonFillElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
 
    this.Children.Add(button);
    button.Click += Button_Click;
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Themes and Visual Style Builder
Asked by
Dominik
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or