Hi,
I have a base form with a RadPageView and one RadPageViewPage. I dropped two RadPanel and one RadGridView into the RadPageViewPage. I set the modifier property of all this five controls to public. And then I save this RadForm.
I created a second RadForm and inherited this one from the previous one. In this second form I can see all the controls in the designer. I can modified the properties of the two RadPanels but I can't modified the properties of the RadGridView in the properties windows.
What can I do in order to modified the properties of the RadGridView of the second form at design time ?
5 Answers, 1 is accepted
Thank you for writing.
This is a known issue of Windows Forms design-time in general. Some complex controls cannot be reliably edited and are therefore the visual inheritance is disabled. More information can be found in the following discussion: c# - DataGridView locked on an inherited UserControl.
I hope this will be useful.
Regards,
Dimitar
Telerik

Hi Dimitar,
Thanks for the clarification. I thought it was something regarding RadGridView because I coud modify RadPanel's properties but not RadGridView's but it's a known issue of the designer.
I followed your link and found a workaround by creating a usercontrol:
[System.ComponentModel.Designer(typeof(System.Windows.Forms.Design.ControlDesigner))]
public class ucRadGridView : Telerik.WinControls.UI.RadGridView { }
I tried this and it seems to work fine. I can modify ucRadGridView's properties in the subclass form.
I guess the Designer attribute is forcing the designer to unlock this control at design time but I don't know if there are other side effect.
Would you recommend this workaround ?
Do you know of any other side effects or problems when using this workaround ?
Thanks,
Man Sai.
Thank you for writing back.
I have tested this and it appears that there are no issues when this is used. However, I cannot guarantee that it will work in all cases. Please note that generally using a grid in parent form is not a common case and perhaps you should consider adding your grids to the child forms (this shouldn't slow down the development process because usually a single form does not contain many grids). Another approach would be to leave the grid in the parent form and change its properties in the code behind.
I hope this information helps.
Regards,
Dimitar
Telerik

[Designer(
typeof
System.Windows.Forms.Design.ControlDesigner))]
public
class
InheritedRadGridView : RadGridView { }
Thank you for writing.
I have tested this and it appears to work on my side. I have attached sample project. I only needed to change the column names because they were duplicated.
I hope this will be useful.
Regards,
Dimitar
Progress Telerik