Can't modify properties of a RadGridView inherited from a base form

6 posts, 1 answers
  1. Man Sai
    Man Sai avatar
    2 posts
    Member since:
    Sep 2015

    Posted 24 Sep 2015 Link to this post

    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 ?

     

     

     

     

     

     

  2. Dimitar
    Admin
    Dimitar avatar
    2514 posts

    Posted 25 Sep 2015 Link to this post

    Hi Man,

    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
    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 Feedback Portal and vote to affect the priority of the items
  3. Man Sai
    Man Sai avatar
    2 posts
    Member since:
    Sep 2015

    Posted 25 Sep 2015 in reply to Dimitar Link to this post

    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.​

     

  4. Answer
    Dimitar
    Admin
    Dimitar avatar
    2514 posts

    Posted 29 Sep 2015 Link to this post

    Hi Man,

    Thank you for writing back.

    I have tested this and it appears that there are no issues when this workaraund 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
    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 Feedback Portal and vote to affect the priority of the items
  5. Joshua
    Joshua avatar
    12 posts
    Member since:
    Apr 2018

    Posted 11 Apr 2018 in reply to Dimitar Link to this post

    I apologize for re-opening an older thread, but we are looking to replace Janus GridEx and I have been unable to get your workaround to work so far.  I have tried inheriting from the RadGridView but with no luck.  I am still unable to add columns to it through the designer.  I realize this is a corner case most people likely don't use, but our existing codebase uses it a ton so I was really hoping to be able to leverage existing code. (We have child forms that re-use the same shared columns but add their own)  Does anyone have a more complete example?
    [Designer(typeof System.Windows.Forms.Design.ControlDesigner))]
    public class InheritedRadGridView : RadGridView { }
  6. Dimitar
    Admin
    Dimitar avatar
    2514 posts

    Posted 12 Apr 2018 Link to this post

    Hi Joshua,

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