标签:complete for bind convert tor datarow mode filter mss
DataTable移除行
strFilter = "PaymentDate = ‘" + DateTime.MinValue + "‘ OR PaymentAmount = ‘" + decimal.Zero +
"‘ OR VC_PaymentMode = ‘" + string.Empty +
"‘ OR VC_PaymentMode IS NULL ";
DataRow[] drsIncompleteData = null;
drsIncompleteData = _Model.PurchasePaymentItemEntityList.GetEntityDataTable().Select(strFilter);
foreach (var dr in drsIncompleteData)
{
_Model.PurchasePaymentItemEntityList.GetEntityDataTable().Rows.Remove(dr);
}
<DataGrid x:Name="dgPaymentItem"
Style="{DynamicResource DataGridStyle}"
RowStyle="{DynamicResource DataGridRowStyle}"
ColumnHeaderStyle="{DynamicResource DataGridColumnHeaderStyle1}"
CanUserAddRows="False" SelectionMode="Single"
ItemsSource="{Binding Path=PurchasePaymentItemEntityList}"
IsReadOnly="{Binding Path=PurchaseOrderEntity.IsClosed, Converter={StaticResource BooleanToReadOnlyConverter}}"
<DataTemplate.Triggers>
<DataTrigger
Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type DataGrid}}, Path=IsReadOnly}"
Value="True">
<Setter TargetName="btnDeletePayment" Property="Visibility" Value="Collapsed" />
</DataTrigger>
</DataTemplate.Triggers>
标签:complete for bind convert tor datarow mode filter mss
原文地址:http://www.cnblogs.com/zhaowei303/p/6209948.html