When we have a filter applied, and a selected record's data changes such that it should be filtered out, the record does not disappear until a different record is selected. If that record is the only item left visible in the grid, it's impossible to deselect the selected record, so it does not disappear. How can I make it so that a record disappears regardless of whether or not it is selected?
Here is my xaml:
<grid:NTGrid x:Name="grdOrder" Grid.Row="1" AutoFit ="False" FieldLayoutInitialized ="OnFieldLayoutInitialized" GroupByAreaLocation ="None" GroupByAreaMode ="DefaultFieldLayoutOnly" Tag ="OrderGrid" > <grid:NTGrid.FieldSettings> <igDp:FieldSettings AllowEdit ="False" CellClickAction ="SelectRecord" GroupByRecordPresenterStyle="{StaticResource OrdersGridGroupByRecordPresenter}" LabelClickAction ="SortByOneFieldOnly" LabelTextAlignment ="Center" LabelTextWrapping ="NoWrap"/> grid:NTGrid.FieldSettings> <grid:NTGrid.FieldLayoutSettings> <igDp:FieldLayoutSettings AllowClipboardOperations ="Copy" AllowDelete ="False" AllowFieldMoving ="WithinLogicalRow" AutoFitMode ="OnlyWithVisibleStarFields" AutoGenerateFields ="False" CopyFieldLabelsToClipboard ="True" HeaderPlacementInGroupBy ="OnTopOnly" HeaderPrefixAreaDisplayMode ="FieldChooserButton" MaxSelectedRecords ="1" RecordSelectorLocation ="None" ReevaluateFiltersOnDataChange ="True" SelectionTypeCell ="None" SelectionTypeRecord ="Single" /> </grid:NTGrid.FieldLayoutSettings>
Hello Dierk,
Thank you for your post I have been looking into it and I can suggest you set the XamDataGrid’s UpdateMode Property to OnCellChangeOrLostFocus in order to make the Cell’s Value update when you leave the cell or press enter key. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Stefan, thanks for the reply.
That doesn't seem to do it. Look at the below screenshot. The State column is what we filter on programmatically. Notice that the second row is selected.
Now, assume the State changes. In our case, all items with a Cancelled state are filtered out. Once the data updates, the first, third, and fourth row all disappear. However, because the second row was selected, it still appears in the grid even though its state is Cancelled.
What I want to have happen is for that row to also disappear even though it was selected. Whether there's a property to toggle this behavior, or some kind of filter event that I can handle when the data updates, I want all filtered rows to disappear regardless of their selection status.
Since I cannot be completely sure how your data is organized and how and when you add filters and update your data, I am not able to say what can cause the behavior you have, so could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
By any chance has a solution to this ever been provided, as we're currently up against the same issue?
To recap - You have a filter on a XamDataGrid, and say Row X is selected. Now Row X has had a property change notification fired such that that row should now be filtered out of the the XamDataGrid.
If the row was not selected, this works just fine. If it is selected however, it incorrectly remains in view until you click somewhere else or scroll it out of view. It seems the filter disregards the currently selected row.
Has a solution ever been found for this please?
Thanks!