Customizing CollectionEditor

5 posts, 0 answers
  1. AndrewRichards
    AndrewRichards avatar
    9 posts
    Member since:
    Oct 2011

    Posted 04 Jul 2012 Link to this post

    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! 
  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 04 Jul 2012 Link to this post

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

  3. UI for WPF is Visual Studio 2017 Ready
  4. AndrewRichards
    AndrewRichards avatar
    9 posts
    Member since:
    Oct 2011

    Posted 05 Jul 2012 Link to this post

    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..
  5. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1127 posts

    Posted 05 Jul 2012 Link to this post

    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 >>
  6. AndrewRichards
    AndrewRichards avatar
    9 posts
    Member since:
    Oct 2011

    Posted 05 Jul 2012 Link to this post

    Thanks, that should do it!
Back to Top
UI for WPF is Visual Studio 2017 Ready