I can either add a filter condition to the filter collection or change the rowfilter on the underlying root dataview and filtering in the grid is immediately reflected. If I instead use any other fieldlayout (e.g. index > 0), neither method filters out the child data. Can you please advise on whether this is a problem in the grid, whether there is a workaround, or whether something needs to be done differently for child layouts? Thanks in advance, as this is a huge problem for us.
THIS WORKS:
Infragistics.Windows.DataPresenter.
oFieldLayout = XDG.FieldLayouts[0]; Infragistics.Windows.DataPresenter.
oRecordFilterColl = oFieldLayout.RecordFilters; Infragistics.Windows.DataPresenter.
; oRecordFilter =
oRecordFilter =
]); oRecordFilter.Conditions.Add(
oRecordFilter.Conditions.Add(
.Equals, 1));
oRecordFilterColl.Add(oRecordFilter);
THIS DOES NOT:
oFieldLayout = XDG.FieldLayouts[1]; Infragistics.Windows.DataPresenter.
HI,
I will bring this issue to the attention of the deveopers.
I created a private case for this issue.
Sincerely,
Matt DSE
HI Rkarpelowitz,
Place your filter logic inside of the XamDataGrid's FieldLayoutInitialized Event.
Here is a code snippet:
void dpresenter1_FieldLayoutInitialized(object sender, Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializedEventArgs e) { RecordFilter ModelRecordFilter = new RecordFilter { FieldName = "Make" }; ComparisonCondition ModelCondition = new ComparisonCondition(ComparisonOperator.NotEquals, "ford"); ModelRecordFilter.Conditions.Add(ModelCondition); if (dpresenter1.FieldLayouts.Count == 2) dpresenter1.FieldLayouts[1].RecordFilters.Add(ModelRecordFilter); }
Sincerely, Matt DSE