Hi.
I have a list-based property that I want to display in the xamPropertyGrid. I want to display it as read-only, i.e. I don't want the option to add/remove items to the list using the property grid. I also want to cutomize the way the items are presented in the property grid.
I have played around with the corresponding sample (xamPropertyGrid->Display->Customizing Expandable Properties) in the Samples Browser, but the current sample does not give me exactly what I want. Attached is an annotated screenshot from the Samples Browser. I have the following questions:
1. How to configure/remove the text displayed withing the red ellipse?
2. How to remove the minus-signs displayed within the blue ellipse at the right edge?
Regarding question 2, I have tried to set the property to read-only using the ReadOnly attribute, but that does not help. If I set the property to return e.g. a IReadOnlyList the minus signs do go away. However, I then have trouble getting my type descriptors to work to e.g. modify the default item labels to someting else than '[0]', '[1]' etc.
Regards,Leif
This issue is fixed in the WPF 20152.2100 Service Release.
I need to use the December SR since it contains several important fixes for the xamPropertyGrid. However, the since this 'UI artifact' does not make anything crash I'm happy to use the SR until a fix is available.
Hi Leif,
Oh! That makes a lot more sense. Normally we ship our samples browser with the base version of the assemblies (15.2.20152.1000) which is what I tested with. So that is why I didn't reproduce it. I'm able to see the issue now.
I logged a development issue for this to have our engineering staff examine it further. In order for you to track it I created a private support case for you which has been linked to the development issue ID. The ID is 211370 and the case number is CAS-167769-Q1Z2S4.
I guess for now you can stick with the base version if the December SR was not necessary for anything critical in your app.
It looks to me now that this is an issue introduced with the latest (December) 15.2 Service Release. If I revert to the previous 15.2 binaries (v15.2.20152.1000) everything works fine, i.e. the text is not changing when expanding the collection. If I use the SR binaries (v15.2.20152.2038) I get the error.
This looks to behave the same for the Samples Browser. If I run the Samples Browser from code that I compile (with the SR binaries) I get the error. If I run the installed Samples Browser executable (that uses v15.2.20152.1000 binaries from the GAC), everything works fine.
Based on the sample you referred to I take it you are using 15.2? I'm running that sample right now but I don't see the "Employee's Collection" text changing when I expand the collection to view the collection items. Adding/removing items and expanding the individual items doesn't affect this text either. What versions of .NET do you have installed on that machine?