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

Material Themes and RadGridView

1 Answer 241 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Mateusz
Top achievements
Rank 1
Mateusz asked on 21 Jan 2020, 02:22 PM

     Hello,

I have an application, which is using RadGridView with additional DragDrop functionality and I have encoutered problems with applying all "Material xxx" themes for such a grid.

 

To find out the problem I have created new project from scratch, with new class: 

using Telerik.WinControls.UI;
 
namespace root
{
    public class CustomGrid : RadGridView
    {
        public CustomGrid()
        {
 
        }
    }
}

 

and then I have added 3 grids into WinForm. 

First one is just normal RadGridView with "Material" grid applied, second is CustomGrid with "Material" theme applied and third one is CustomGrid with Office2010Black theme applied, as can be seen in attachment. First and third controls are working as intended, but there is a problem with the middle one.

As You see, the grid in the middle does not apply selected Material Theme - in such cases it is using "Fluent" theme all the time. The problem is connected with all 4 Material themes available in current version of WinControls. Is it possible to change it in easy way? I have changed like 80% of application and all grids which are not supporting DragDrop to this Material Theme, and it is blocking me from releasing this new version to customer. 

 

Regards,

Mateusz

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 23 Jan 2020, 02:23 PM

Hello Mateusz,

The provided information is greatly appreciated. I would like to note that when you inherit from a RadControl (or any RadControl descendant), the original control themes are not automatically inherited. The good thing is that this behavior can be overridden very easily by overriding the ThemeClassName property of the descendant of RadControl. You should override this property in your CustomGrid class:

public class CustomGrid:RadGridView
{
    public CustomGrid()
    {
    
    }
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadGridView).FullName;
        }
    }
}

The achieved result is demonstrated in the attached picture. You can find more documentation on this topic here: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/inherit-themes-from-radcontrols-derivatives

Please let me know if there is anything else I can help you with. 

Regards,
Nadya
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Themes and Visual Style Builder
Asked by
Mateusz
Top achievements
Rank 1
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or