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

Customizing CollectionEditor

4 Answers 266 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
AndrewRichards
Top achievements
Rank 1
AndrewRichards asked on 04 Jul 2012, 10:58 AM
Hello,

I've encountered two bugs (or oddities) with editing collections with propertygrid's collectioneditor:

1) If the main grid in PropertyGrid can be sorted as categorical or alphabetical, then it seems than CollectionEditor is always A-Z sorted (there's no button for sorting it categorically). Is there a workaround ?

2) CollectionEditor displays collection item names using addeditem.ToString(). Is there a way to bind a child item property to be it's display name in the collectioneditor ?

Thanks! 

4 Answers, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 04 Jul 2012, 11:24 AM
Hello Andres,

The removal of the "sorting mode" buttons from CollectionEditor's RadPropertyGrid is by design. You can easily override this behavior by finding the RadPropertyGrid in the visual tree and setting its IsGrouped property to true. If you want do display the buttons themselves, you can modify the SortAndGroupButtonsVisibility property. As for the second inquiry of yours, we have had a few similar requests, so that we have introduces the ItemTemplate property. You can test this with our latest internal build.

All the best,
Ivan Ivanov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
AndrewRichards
Top achievements
Rank 1
answered on 05 Jul 2012, 07:08 AM
Thanks! 

Now I'm having troubles with resizing CollectionEditor (it's too small).

I can change the width of the window like this:

        <Style TargetType="telerik:CollectionEditor">
            <Setter Property="Width" Value="700"/>
        </Style>

However the left list resizes with the propertygrid in the collectioneditor..
0
Ivan Ivanov
Telerik team
answered on 05 Jul 2012, 07:13 AM
Hi,

CollectionEditor's Template is hosted in a Grid with the following ColumnDefinitions:
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
As both columns have relative width values it is expected for both of them to resize, when resizing occurs. You may try modifying CollectionEditor's template, by setting a hard-coded Width value for the first column, in order to override this behavior.

Greetings,
Ivan Ivanov
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
AndrewRichards
Top achievements
Rank 1
answered on 05 Jul 2012, 07:30 AM
Thanks, that should do it!
Tags
PropertyGrid
Asked by
AndrewRichards
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
AndrewRichards
Top achievements
Rank 1
Share this question
or