When a property grid cell is bound to a collection object, currently the comobox for it is displayed empty.
Can I have this show the number of items the object holds?
Thanks!!
12 Answers, 1 is accepted
You can predefine the template and bind the TextBox's Text to the Control's CollectionView property. Then, in a converter you can retrieve the SourceCollection's Count and pass it to the binding.
Regards,Ivan Ivanov
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Just a quick note, In case you are using a List<T> as Source, you can directly bind it to Source.Count.
Regards,Ivan Ivanov
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Thank you very much!
You can check this article on how to extract the template of a control. Once you have the template of CollectionEditorPicker, you can bind the TextBlock's Text property to Source.Count (if you use List<T> as mentioned above) - it should be something similar to: Text="{Binding Source.Count ..... }".
Maya
Telerik
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Is there any other ways to display text like (Collection) instead of leaving the field empty?
You can try getting the template of collection editor from the xaml files provided with our NoXaml binaries and edit it without the need of working with Blend.
Regards,
Maya
Telerik
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 >>

http://stackoverflow.com/questions/8825030/how-to-extract-default-control-template-in-visual-studio
1. Create a new WPF project. (VS2010)
2. Add a Collection Editor from toolbox.
3. Change the reference to NoXaml binaries.
4. From Visual studio - right click the control, choose properties,
5. In the properties window look for the Template Property and right click it, choose Extract Value To Resource
However, no success. (See attached screen shot).
By the way, i am not Dodd and sorry for hijacking this thread.
I'm sorry, I should have been more detailed. Together with our NoXaml binaries, we provide all xaml files containing the styles and templates of the controls. Please take a look at this article for more information. The file you need to work with for RadPropertyGrid is Telerik.Windonws.Controls.Data.xaml.
As for extracting the template with Visual Studio, as far as I know this is supported with Visual Studio 2012 and above.
Regards,
Maya
Telerik
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 >>

1) there is nothing for me to look at in Telerik\RadControls for WPF Q3 2013\Binaries.NoXaml
2) i can get the Telerik.Windows.Controls.Data.xaml file from Telerik\RadControls for WPF Q3 2013\Themes.Implicit\WPF40\OfficeBlack\Themes - assuming i am using OfficBlack theme.
3) There is a risk for the control to misbehave if i change to another theme.
Will dig more into it and see whether i can display the (Collection) text in the empty space.
Which make me wonder shouldn't this be a default behavior or something easily accomplished?
We will consider improving the behavior and I will research whether we can change the behavior without introducing breaking changes. But indeed, you will have to modify the template in each theme you want to work with.
Regards,
Maya
Telerik
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 >>

Thanks. Wonderful support.
And again, i am not Dodd.
joel
I'm really sorry for mixing up the names again. It looks like I'm a bit absent-minded during the holidays :)
Regards,
Maya
Telerik
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 >>