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
190
xamDataCards Sort not working when underlying data is updated.
posted

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.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="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>