Thanks Marcus. I can get the AutoFilter mode to work, but it still isn't automatically updating the grid rows as the underlying values change. Here are the relevant parts of my code:
// xaml.cs Constructor
public ProcessMonitor()
{
// Hook up the grid
DataGridCollectionViewSource src = new DataGridCollectionViewSource();
dataGrid.ItemsSource = src.View;
src.AutoFilterMode = AutoFilterMode.Or;
src.DistinctValuesConstraint = DistinctValuesConstraint.Filtered;
src.AutoCreateItemProperties = true;
src.Source = ThreadManager.WorkItems;
// Hook up the Auto grid filter
dataGrid.Loaded += new RoutedEventHandler(dataGrid_Loaded);
}
void dataGrid_Loaded(object sender, RoutedEventArgs e)
{
// Get the grid context
DataGridContext gridContext = DataGridControl.GetDataGridContext(dataGrid);
// Set Status autofilter values
gridContext.AutoFilterValues["Status"].Add(ThreadStatus.Pending);
gridContext.AutoFilterValues["Status"].Add(ThreadStatus.InProgress);
gridContext.AutoFilterValues["Status"].Add(ThreadStatus.Aborted);
//gridContext.AutoFilterValues["Status"].Add(ThreadStatus.Completed);
}
As I add processes, I can see their status change in the grid, with the last status being Completed. Since I'm not setting an AutoFilterValue for Completed, I expect the items to disappear from the grid when their status changes to Completed. That's not happening--they just stay there with the Completed value displayed on the grid.
Update: Let me clarify something that may be relevant. I'm not changing these values *in* the grid, they're being automatically updated and the grid just displays them in read-only mode. All of the updates are displayed correctly on the grid as the changes happen, with the exception of the Filters, which seem to only be applied when the item is initially inserted into the grid.
Thanks again.