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

Components locked when inherits a form

11 Answers 1366 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sergio
Top achievements
Rank 1
Sergio asked on 30 Dec 2009, 08:15 AM
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.

11 Answers, 1 is accepted

Sort by
0
Accepted
Victor
Telerik team
answered on 30 Dec 2009, 09:55 AM
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.
0
Sergio
Top achievements
Rank 1
answered on 30 Dec 2009, 11:22 AM
Wel... I am going to study an alternative way to do that with RadControls for WinForms...

Thank you so much.
0
Cyril Hr
Top achievements
Rank 1
answered on 07 Apr 2010, 11:01 AM
Hello, I was wondering if there's any progress about this problem ?

Thx
0
Cyril Hr
Top achievements
Rank 1
answered on 07 Apr 2010, 04:27 PM
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
0
Victor
Telerik team
answered on 08 Apr 2010, 08:31 AM
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.
0
Hugo Furth
Top achievements
Rank 1
answered on 12 Jan 2015, 11:46 PM
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?
0
Dimitar
Telerik team
answered on 14 Jan 2015, 01:31 PM
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.

 
0
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 20 Apr 2018, 12:36 PM
So, here we are 8+ years after the original post, and I am trying to do the same thing with a RadGridView control. I figured, that in that amount of time, something like this would have been fixed.  However, to this day, a Grid, while it can be inherited, it cannot be changed on the inherited form, unless I am doing something wrong.  Anyone from Telerik like to add some input?
0
Dimitar
Telerik team
answered on 23 Apr 2018, 08:03 AM
Hello Mark,

This is how the Visual Studio designer works (some complex controls cannot be reliably edited and are therefore the visual inheritance is disabled) and this is not connected to our functionality. There is another post that explains how you can access the properties window in the inherited form. There is a sample project as well: Can't modify properties of a RadGridView inherited from a base form - GridView.

Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
answered on 23 Apr 2018, 12:04 PM

Yea, i see that.  I found my own work around, as the grid control itself is a user control (don't want any changes to it properties, other than DOCK and/or ANCHOR).  So, I just placed the RadGridView in a RadPanel and set the dock on the grid to FULL.  Set the modifiers on the panel to protected, now I can move, resize, etc all I need.  Thanks for the response. 

0
Dimitar
Telerik team
answered on 23 Apr 2018, 12:44 PM
Hello Mark,

I am glad that you have found a solution. Do not hesitate to contact us if you have other questions.

Regards,
Dimitar
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Sergio
Top achievements
Rank 1
Answers by
Victor
Telerik team
Sergio
Top achievements
Rank 1
Cyril Hr
Top achievements
Rank 1
Hugo Furth
Top achievements
Rank 1
Dimitar
Telerik team
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Share this question
or