How to show read-only fields using

5 posts, 0 answers
  1. Gerard
    Gerard avatar
    3 posts
    Member since:
    Sep 2012

    Posted 19 Aug 2015 Link to this post

    I'm using a RadPropertyGrid to display a categorized list of string fields. I don't want the user to be able to edit the fields, but I do want them to be able to select and copy the text in the fields. In order to do this, I set the IsReadOnly property of the PropertyGrid to True. When I do this, the text fields are grayed-out. I don't like this because it makes the fields hard to read, and it is less obvious to the user that they are able to copy the text in the grayed-out fields.

    I have looked all over the place, and tried a number of suggestions, to make the grayed-out fields look like normal fields, but nothing so far has worked. 

    The XAML I am using to define the property grid is pretty simple:

    <telerik:RadPropertyGrid Grid.Row="1" Name="propGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsGrouped="True" SortAndGroupButtonsVisibility="Collapsed" SearchBoxVisibility="Collapsed" RenderMode="Flat" IsReadOnly="True" Item="{Binding DynItem}" />

    The CurrentReadOnly.png file shows the current situation, where the read-only fields are grayed-out. The DesiredReadOnly.png file shows the look I am trying to achieve. 

    Is there a way to do this (preferably keeping the rest of the currently selected theme intact).

  2. Gerard
    Gerard avatar
    3 posts
    Member since:
    Sep 2012

    Posted 19 Aug 2015 in reply to Gerard Link to this post

    The title of my original post should have been: How to show read-only fields using a normal style

     but I can't edit it...

    Also, your forum software wrecked my uploaded pictures, making it very hard to see the difference between the two. Just imagine the right column of the CurrentReadOnly.png file being heavily grayed-out.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Martin Vatev
    Admin
    Martin Vatev avatar
    90 posts

    Posted 24 Aug 2015 Link to this post

    Hello Gerard,

    To achieve your goal, you may use the ReadOnlyEditorState property. You need to configure RadPropertyGrid with:
    ReadOnlyEditorState="ReadOnly"
    IsReadOnly="True".

    Regards,
    Martin Vatev
    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. Gerard
    Gerard avatar
    3 posts
    Member since:
    Sep 2012

    Posted 31 Aug 2015 Link to this post

    Hi Martin, 

    Thanks for your reply. I played a little more with my application. If I use the default style, the ReadOnlyEditorState attribute works.  However, I want to use the 'Visual Studio 2013' implicit style. With that style, the attribute does not make a difference. I am currently trying to determine what changes are required in the 'Visual Studio 2013' style templates to implement this functionality. I would appreciate any guidance you might have re: the files and/or templates to change..

  6. Martin Vatev
    Admin
    Martin Vatev avatar
    90 posts

    Posted 02 Sep 2015 Link to this post

    Hi Gerard,

    Please take a look at basing styles on theme style to understand how implicit styles works and how to add custom styles to our controls.

    I hope this helps.

    Regards,
    Martin Vatev
    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
Back to Top
UI for WPF is Visual Studio 2017 Ready