如何在网格视图中查找重复的行 [英] How to find duplicate row in Grid view

查看:108
本文介绍了如何在网格视图中查找重复的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个gridview,它有一些具有相同id的行,我想找到相同的id并隐藏其中一个

帮我plz

i have a gridview ,it has some rows with the same id ,i want to find the same ids and hide one of them
help me plz

推荐答案

首先从不向gridview添加副本怎么样?
What about never add duplicate to gridview in the first place ?


尝试在查询本身中过滤此重复的id /行。

这将是摆脱重复的最优化方法。
Try to filter this duplicate id / row in the query itself.
This would be the most optimized way of getting rid of duplicates.


这不是一个好主意。更好地处理DataSource中的这些事情。过滤DataSource(DataTable或其他)中的数据&然后将其绑定到GridView。



供您参考

DataView.RowFilter Property [ ^ ]
It's not a good idea. Better handle those things in DataSource. Filter the data in DataSource(DataTable or something) & then bind it to GridView.

For your information
DataView.RowFilter Property[^]


这篇关于如何在网格视图中查找重复的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆