如何遍历XamDataGrid中所有未过滤的行?

时间:2019-03-04 11:34:49

标签: c# wpf xaml infragistics xamdatagrid

我有一个允许记录过滤的XamDataGrid。第一个字段是“选定”复选框,其余字段只是我在网格中显示的对象中的数据。在代码方面,它看起来像这样:

<div *ngIf="!rowCommands[i].defaultSelected[opt_indx]" class="defaultBadge">
    <a class="badge badge-secondary" matTooltip="Click here to set this Option as Default"
        (click)="$event.stopPropagation();markDefault(i,option.id)">Default</a>
</div>

我的最终目标是在<igWPF:XamDataGrid x:Name="xamDataGrid" DataSource="{Binding SomeDataSourceInTheViewModels}"> <!-- XamDataGrid Settings --> <igWPF:XamDataGrid.FieldLayoutSettings> <igWPF:FieldLayoutSettings FilterAction="Hide" FilterUIType="LabelIcons"/> </igWPF:XamDataGrid.FieldLayoutSettings> <igWPF:XamDataGrid.FieldSettings> <igWPF:FieldSettings ... AllowRecordFiltering="True" FilterOperatorDefaultValue="Equals" FilterLabelIconDropDownType="MultiSelectExcelStyle" .../> </igWPF:XamDataGrid.FieldSettings> <!-- XamDataGrid Field layout --> <igWPF:XamDataGrid.FieldLayouts> <igWPF:FieldLayout> <igWPF:Field Label="Selected" Name="Selected" Width="Auto"> <!-- Select/Unselect all button --> <igWPF:Field.Settings> <igWPF:FieldSettings AllowEdit="True"> <igWPF:FieldSettings.LabelPresenterStyle> <Style TargetType="{x:Type igWPF:LabelPresenter}" BasedOn="{StaticResource {x:Type igWPF:LabelPresenter}}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igWPF:LabelPresenter}"> <!-- The Select all checkbox --> <CheckBox /> </ControlTemplate> </Setter.Value> </Setter> </Style> </igWPF:FieldSettings.LabelPresenterStyle> </igWPF:FieldSettings> </igWPF:Field.Settings> </igWPF:Field> <!-- The rest of the fields --> <igWPF:Field Label="SomeIntValue" Name="SomeIntValue" Width="Auto"/> <igWPF:Field Label="SomeBoolValue" Name="SomeBoolValue" Width="Auto" /> <igWPF:Field Label="SomeStringValue" Name="SomeStringValue" Width="Auto" /> </igWPF:FieldLayout> </igWPF:XamDataGrid.FieldLayouts> </igWPF:XamDataGrid> 列上方的数据网格顶部具有一个复选框,在其中可以单击并选择所有未过滤的行。我对如何实现此方法有新想法,但我的问题是:如何在代码隐藏或ViewModel中循环浏览所有未过滤的行?

我知道某处有一个“ IsFilteredOut”属性,但在Selected中找不到它

1 个答案:

答案 0 :(得分:0)

RecordManager GetFilteredOutDataRecords()方法返回所有未通过记录过滤条件的数据记录:

with open('topname.txt', 'a') as f:
    f.write(str(name))

希望有帮助。