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

How to show read-only fields using

4 Answers 141 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Gerard
Top achievements
Rank 1
Gerard asked on 20 Aug 2015, 12:38 AM

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

4 Answers, 1 is accepted

Sort by
0
Gerard
Top achievements
Rank 1
answered on 20 Aug 2015, 12:45 AM

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.

0
Martin
Telerik team
answered on 24 Aug 2015, 08:26 AM
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
0
Gerard
Top achievements
Rank 1
answered on 31 Aug 2015, 10:07 PM

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

0
Martin
Telerik team
answered on 02 Sep 2015, 04:01 PM
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
Tags
PropertyGrid
Asked by
Gerard
Top achievements
Rank 1
Answers by
Gerard
Top achievements
Rank 1
Martin
Telerik team
Share this question
or