Material Themes and RadGridView

2 posts, 1 answers
  1. Mateusz
    Mateusz avatar
    14 posts
    Member since:
    Jul 2012

    Posted 21 Jan Link to this post

         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

     

     

  2. Answer
    Nadya
    Admin
    Nadya avatar
    389 posts

    Posted 23 Jan Link to this post

    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.
Back to Top