set [Readonly] attribute programmatically

4 posts, 1 answers
  1. Naseem
    Naseem avatar
    70 posts
    Member since:
    Nov 2010

    Posted 23 Oct 2013 Link to this post

    Hello,

     In PropertyGrid we can set [Readonly(true)] attribute to make a property readonly , but status of my property will change at run time. I was wondering if there is any way to set [Readonly] attribute programmatically?

    Many thanks,

    Kind regards,
    Naseem
  2. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 24 Oct 2013 Link to this post

    Hi Naseem,

    PropertyDefinition has IsReadOnly property that you can work with. Check out this article for a reference. 

    Regards,
    Maya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Dennis
    Dennis avatar
    3 posts
    Member since:
    Oct 2014

    Posted 17 Oct 2014 Link to this post

    How can I set this and other attributes programmatically in a WinForm PropertyGrid.    At runtime, I'm adding items to the propertystore and need to set the type of editor, aspects such as treat this like a password, drop down list of choices with a defined list, etc.    Standard editors exist for all these items, but the only way I can see to set them is via attributes on properties in a class and not at runtime.
  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 20 Oct 2014 Link to this post

    Hi Dennis,

    If you are working with RadRropertyGrid for WinFoms, please drop a line at the corresponding forum. Otherwise, the thread here will become a bit confusing whether the answers targets Silverlight or WinForms.
    Thanks a lot for the understanding. 


    Regards,
    Maya
    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