猿问
datagridview获取某查询条件的数量
如何得到datagridview中某列="某值"的数量?<br>
斯蒂芬大帝
浏览 464
回答 2
2回答
GCT1015
public int GetRowsCountByTargetColumn(GridView gv, int targetColumnIndex, string targetColumnValue) { bool ap = gv.AllowPaging; if(ap) gv.AllowPaging = false; int count = 0; foreach(GridViewRow row in gv.Rows) { if(row.Cells[targetColumnIndex].Text.Equals(targetColumnValue)) count++; } if(ap) gv.AllowPaging = true; return count; }
0
0
0
随时随地看视频
慕课网APP
相关分类
.NET
.net 中 字符串含有超链接,如何给超链接自动加上a标签?
1 回答
请问.net 中用jquery传值安全吗?
2 回答
我要回答