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
875
Sorting by DataItemIndex
posted

I am trying to get the sort working correctly on this field in a xamdatapresenter.  The ascending sort seems to work fine (1, 2, 3 ,4 ,5 ,6,7,8,910,11,12,13,14,15,16) but when i click the arrow for descending, the order is incorrect.  It is (16,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15). ??  Um, why does 16 come before everything else here?  Also, is there an easy way to sort alphabetically vs numerically etc?

 

<igDP:UnboundField x:Name="Index" Label="#" Column="0" RowSpan="2" Converter="{StaticResource ValueConverter}">
                                <igDP:UnboundField.Settings>
                                    <igDP:FieldSettings CellMinWidth="30" CellMaxWidth="30">
                                        <igDP:FieldSettings.CellValuePresenterStyle>
                                            <Style TargetType="{x:Type igDP:CellValuePresenter}">
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                                            <TextBlock Text="{Binding Path=DataItemIndex, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource IndexConverter}}" VerticalAlignment="Center"/>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </igDP:FieldSettings.CellValuePresenterStyle>
                                    </igDP:FieldSettings>
                                </igDP:UnboundField.Settings>
                            </igDP:UnboundField>
______________________________________________________
i coudn't see most of the code when i viewed this, so here it is again below

<igDP:UnboundField x:Name="Index" Label="#" Column="0"
RowSpan="2" Converter="{StaticResource ValueConverter}">
<igDP:UnboundField.Settings>
<igDP:FieldSettings >
<igDP:FieldSettings.CellValuePresenterStyle>
<Style TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
<TextBlock Text="{Binding Path=DataItemIndex,
UpdateSourceTrigger=PropertyChanged,
Converter={StaticResource IndexConverter}}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</igDP:FieldSettings.CellValuePresenterStyle>
</igDP:UnboundField.Settings>
</igDP:UnboundField>

oh i included the indexconverter and valueconverters as well