The control is assigned to Obs<> datasource and when I update one of the object "UpdateDateTime" (data type datetime), the cards do not get sorted.
Is there a way I can force the sorting after a change in the datasource updates?
I have also made the fields visible and I do see the value updated, but it cards do not get sorted.
I have the same issue with both the example code. Thanks for help
Example 1:
<DataPresenter:XamDataCards x:Name="xamDataCards" Theme="Aero" HorizontalContentAlignment="Stretch" ScrollingMode="DeferredWithScrollTips"> <DataPresenter:XamDataCards.ViewSettings> <DataPresenter:CardViewSettings MaxCardCols="1" AllowCardHeightResizing="True" AllowCardWidthResizing="True" CollapseCardButtonVisibility="Visible" HeaderPath="RollingNoteDescription" HeaderVisibility="Visible" ShouldAnimateCardPositioning="False" /> </DataPresenter:XamDataCards.ViewSettings>
<DataPresenter:XamDataCards.FieldLayoutSettings> <DataPresenter:FieldLayoutSettings AutoArrangeCells="Never" AutoGenerateFields="False" DataRecordSizingMode="SizedToContentAndIndividuallySizable" AllowFieldMoving="No" HighlightAlternateRecords="True" AutoFitMode="ExtendLastField" HighlightPrimaryField="SameAsOtherFields"/> </DataPresenter:XamDataCards.FieldLayoutSettings>
<DataPresenter:XamDataCards.FieldLayouts> <DataPresenter:FieldLayout> <DataPresenter:FieldLayout.SortedFields> <DataPresenter:FieldSortDescription Direction="Descending" FieldName="UpdatedDateTime" /> </DataPresenter:FieldLayout.SortedFields> <DataPresenter:Field Name="Notes" Row="0" Column="0" Label="" Height="Auto" Width="Auto" > <DataPresenter:Field.Settings> <DataPresenter:FieldSettings AllowEdit="False" AutoSizeOptions="DataCells" > </DataPresenter:FieldSettings> </DataPresenter:Field.Settings> </DataPresenter:Field> <DataPresenter:Field Name="UpdatedDateTime" Row="3" Column="0" Label="" Height="Auto" Width="Auto" Visibility="Collapsed"> <DataPresenter:Field.Settings> <DataPresenter:FieldSettings AllowEdit="False" AutoSizeOptions="DataCells" > </DataPresenter:FieldSettings> </DataPresenter:Field.Settings> </DataPresenter:Field> </DataPresenter:FieldLayout> </DataPresenter:XamDataCards.FieldLayouts> </DataPresenter:XamDataCards>
Eaxmple 2:
<DataPresenter:XamDataCards Grid.Row="1" x:Name="xamDataCards" Theme="Aero" HorizontalContentAlignment="Stretch" ScrollingMode="DeferredWithScrollTips"> <DataPresenter:XamDataCards.ViewSettings> <DataPresenter:CardViewSettings MaxCardCols="1" AllowCardHeightResizing="True" AllowCardWidthResizing="True" CollapseCardButtonVisibility="Visible" HeaderPath="RollingHeader" HeaderVisibility="Visible" ShouldAnimateCardPositioning="False" /> </DataPresenter:XamDataCards.ViewSettings>
<DataPresenter:XamDataCards.FieldLayouts> <DataPresenter:FieldLayout> <DataPresenter:FieldLayout.SortedFields> <DataPresenter:FieldSortDescription Direction="Descending" FieldName="UpdateDate" /> </DataPresenter:FieldLayout.SortedFields> <DataPresenter:Field Name="Comments" Row="0" Column="0" Label="" Height="Auto" Width="Auto" > <DataPresenter:Field.Settings> <DataPresenter:FieldSettings AllowEdit="False" AutoSizeOptions="DataCells" > </DataPresenter:FieldSettings> </DataPresenter:Field.Settings> </DataPresenter:Field>
<!--DataPresenter:Field Name="RollingHeader" Row="2" Column="0" Label="" Height="Auto" Width="Auto" > <DataPresenter:Field.Settings> <DataPresenter:FieldSettings AllowEdit="False"> <DataPresenter:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamDateTimeEditor}"> <Setter Property="ValueToTextConverter" Value="{StaticResource dateTimeValueConverter}"/> <Setter Property="ValueToDisplayTextConverter" Value="{StaticResource dateTimeValueConverter}"/> </Style> </DataPresenter:FieldSettings.EditorStyle>
</DataPresenter:FieldSettings> </DataPresenter:Field.Settings> </DataPresenter:Field--> <DataPresenter:Field Name="UpdateDate" Row="3" Column="0" Label="" Height="Auto" Width="Auto" Visibility="Collapsed"> <DataPresenter:Field.Settings> <DataPresenter:FieldSettings AllowEdit="False" AutoSizeOptions="DataCells" > </DataPresenter:FieldSettings> </DataPresenter:Field.Settings> </DataPresenter:Field> </DataPresenter:FieldLayout> </DataPresenter:XamDataCards.FieldLayouts> </DataPresenter:XamDataCards>
Hello,
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into it and I can suggest you call the XamDataCards’ Records’ RefreshSort method in order to refresh the sorting, when the Records are modified.
Feel free to write me if you have further questions.
Anyone who can help? Thanks