Silverlight DataGridRows in a DataGrid - how do I hide them selectively? -


I have an ObservableCollection updating well thats feeding a data grid that is

point:. I want to filter (collapse) rows without extracting them from the collection.

Is there a way to do this, or a scene place on the grid like normal net?

I just

A simple demo application attached to the post shows how to get what you want.

The solution should be sufficient enough to be reusable and based around the following custom extension method:

  public static class extension {/// & LT; Summary & gt; /// implements an action for each object in the sequence, depending on the evaluation of the operation. /// & lt; / Summary & gt; /// & lt; Typ name = "TSource" & gt; The type of elements of the source. & Lt; / Typermum & gt; /// & lt; Param name = "source" & gt; A sequence of filters. & Lt; / Param & gt; /// & lt; Param name = "predicate" & gt; A function to test each element for a condition. & Lt; / Param & gt; /// & lt; Param name = "posAction" & gt; An action which needs to change the elements, which correspond to the condition of the plant. & Lt; / Param & gt; /// & LT; Ultimate name = "negAction" & gt; An action used to mutate the elements that do not match the condition of predicate. & Lt; / Param & gt; /// and lieutenant; Returns & gt; Elements in the sequence that correspond to the state of the ingenuity and were replaced by posAction. & Lt; / Returns> Public stable IEnumerable & lt; TSource & gt; ApplyMutateFilter & LT; TSource & gt; (This IEnumerable & lt; TSource & gt; source & lt; TSource, bool & gt; prediction, action & lt; TSource & gt; posAction, action's & lt; TSource & gt; negAction) {if ( Source = Null!) {Foreach (TSource item in source) {if (item (item)) (Pause action (item);} Other {prohibition (item);}}} Return source where (point);}} < / Code> 

Comments