Components locked when inherits a form

8 posts, 1 answers
  1. Sergio
    Sergio avatar
    3 posts
    Member since:
    May 2009

    Posted 30 Dec 2009 Link to this post

    Hello:

    I am doing some tests with my trial version of RadControls for WinForms. One common way we used to make forms is to create the "master" forms, and then inherit and customize it to concrete requeriments. Well, I am trying to create a "master", let's say "MasterForm" form with this content:

    One RadTextBox, one RadPanelBar and one RadGridView. As usual, I've changed the component's modifiers to protected, in order to be able to edit them in child forms.

    Now I create a specific form, let's say "CustomersForm" inheriting from "MasterForm". All right, the components shows but... what?! the RadTextBox properties can be edited, but both RadPanelBar and RadGridView are locked (despite the fact that I can see, in the child form, that modifier is set to protected. Also, I can see the locked icon over the components when I select them.

    I have tried the following:
    1) Make sure that component's modifiers are set to protected instead of private
    2) Rebuild entire solution to ensure that assemblies are refreshed
    3) Unload / Reload the project
    4) Close / Open Visual Studio

    I don't know what else to do in order to get them unlocked and modify their properties in child forms...

    Thank you so much.
  2. Answer
    Victor
    Admin
    Victor avatar
    1351 posts

    Posted 30 Dec 2009 Link to this post

    Hi Sergio,

    Thank you for the question. This is a known issue of Windows Forms design-time in general. Some complex controls cannot be reliably edited and are therefore disabled. Please have a look at this blog post. Also please note that the standard Microsoft DataGridView also cannot be edited in that specific case.

    Please write again if you have other questions.

    Kind regards,

    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Sergio
    Sergio avatar
    3 posts
    Member since:
    May 2009

    Posted 30 Dec 2009 Link to this post

    Wel... I am going to study an alternative way to do that with RadControls for WinForms...

    Thank you so much.
  5. Cyril Hr
    Cyril Hr avatar
    6 posts
    Member since:
    Apr 2010

    Posted 07 Apr 2010 Link to this post

    Hello, I was wondering if there's any progress about this problem ?

    Thx
  6. Cyril Hr
    Cyril Hr avatar
    6 posts
    Member since:
    Apr 2010

    Posted 07 Apr 2010 Link to this post

    It's me again
    After some digging I've found some works around for the basic gridview

    I've tried to apply them to the RadGridView
    Normaly we juste need to create a new class and inherit from the RadGridView and put an attribut

    [Designer(typeof(System.Windows.Forms.Design.ControlDesigner))] 
        public class MRadGridView : RadGridView 
        { 
            public override string ThemeClassName 
            { 
                get 
                { 
                    return typeof(RadGridView).FullName; 
                } 
            }   
        } 

    Guess what ... not working
    So I'm just wondering if maybe the telerik team may have any idea about a workaround, I really need this functionality 

    Thx in advance
  7. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 08 Apr 2010 Link to this post

    Hi Cyril Hr,
     
    There is no problem with RadControls. The Visual Studio designer purposefully disables some controls in a visual inheritance scenario. When you have such a case you are usually better off making settings at run-time. Also you should not explicitly associate RadGridView with the standard ControlDesigner as there is a huge amount of functionality in the RadControlDesigner that you are omitting this way.

     
    Kind regards,
    Victor
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Hugo Furth
    Hugo Furth avatar
    31 posts
    Member since:
    Dec 2008

    Posted 12 Jan 2015 in reply to Victor Link to this post

    Certainly understand why this is set up the way it is. But wouldn't it make sense to prevent the control's Modifiers from being set to protected? Or are there other reasons one would change Modifiers property of a control at design-time?
  9. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 14 Jan 2015 Link to this post

    Hello Hugo,

    Thank you for writing.

    You are allowed to use any access modifiers for the controls, like you do with every single field in C#. What modifiers are used depends on you and your case. For example our EditAppointmentDialog uses protected modifier for all of its controls. This way our customers can easily inherit this form and rearrange the controls in it.

    Please note that you can only change this in the form where the control is originally created - not in the inherited form. 

    I hope this information helps.

    Regards,
    Dimitar
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready