Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2815
Overriding CellValuePresenter used to display IEnumerable property
posted

By default, the xamDataGrid creates child records for a property that is of type IEnumerable.  Instead, I want to ToString() representation of my collection to be represented in a single field.  I tried using the following CellValuePresenter on the field definition:

    <Style x:Key="SimpleCollectionStyle" TargetType="{x:Type igDP:CellValuePresenter}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                    <Border BorderBrush="{StaticResource DataGridCellOuterBorder}" BorderThickness="1,0,0,0">
                        <TextBlock Text="{Binding DataItem}" Margin="10,5,3,5"   />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
But it did not work.