zoukankan
html css js c++ java
移除DataTable中的行
DataTable table
=
GetTable();
int
count
=
table.Rows .Count;
ArrayList delList
=
new
ArrayList ();
for
(
int
m
=
0
;m
<
count ;m
++
)
{
DataRow dr
=
table.Rows[m];
string
[] processdep
=
dr[
"
ProcessingDep
"
].ToString ().Split (
'
,
'
);
int
Flag
=
0
;
string
dd
=
dr[
"
Processing
"
].ToString ();
int
d
=
dr[
"
Processing
"
].ToString ().IndexOf (DepartmentName);
for
(
int
j
=
0
;j
<
processdep.Length ;j
++
)
{
if
(processdep[j]
==
depId.ToString ())
{
Flag
=
1
;
break
;
}
}
if
(Flag
==
0
)
{
delList.Add (m);
}
else
if
(dr[
"
Processing
"
].ToString ().IndexOf (DepartmentName)
>=
0
)
{
delList.Add (m);
}
}
for
(
int
k
=
delList.Count
-
1
;k
>=
0
;k
--
)
{
int
index
=
Convert.ToInt32 (delList[k]);
table.Rows.RemoveAt (index);
}
table.AcceptChanges ();
DataGrid绑定数据时,需要对数据进行判断,把不符合条件的数据从DataTable中移除掉。
代码如下
查看全文
相关阅读:
听说在新的一年里你的证书过期了
css 清楚浮动的8种方式
Majority Element:主元素
HDOJ 5296 Annoying problem LCA+数据结构
hdu 5318 The Goddess Of The Moon 矩阵高速幂
友盟页面统计
用html语言写一个功课表
苹果新的编程语言 Swift 语言进阶(二)--基本数据类型
Atitit.mssql 数据库表记录数and 表体积大小统计
jeecms 代码生成 Tools
原文地址:https://www.cnblogs.com/nonsuch/p/803243.html
最新文章
bootstraptable的 showFooter属性
with(nolock)的用法
不曾拥有 亦无失去
浅谈 Mybatis中的 ${ } 和 #{ }的区别
Windows下Nginx的启动、停止等命令添加
Windows下Nginx的启动、停止等命令
缺页中断
如何有效利用时间
软件设计师考试心得
Oracle创建用户以及备份还原数据库操作
热门文章
搭建基于qemu + eclipse的kernel调试环境(by quqi99)
crazyradio焊接和下载固件过程
一入python深似海--python之道
RabbitMQserver配置文件
Invalid project description.
iOS之数据请求NSURLConnection
多线程02---pThread简单介绍
算法题:阶乘尾零
Precision and recall From Wiki
jmeter名词解释之时间(Elapsed Time/ Latency Time/Connection Time)
Copyright © 2011-2022 走看看