码迷,mamicode.com
首页 > 其他好文 > 详细

DataTable

时间:2016-12-22 11:26:12      阅读:159      评论:0      收藏:0      [点我收藏+]

标签: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>

DataTable

标签:complete   for   bind   convert   tor   datarow   mode   filter   mss   

原文地址:http://www.cnblogs.com/zhaowei303/p/6209948.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!