如何防止 Telerik RadGridView 列中的重复值
我有一个包含三列的 radgridview:公司、名称、状态。
我想尝试防止按该列排序时出现重复的公司名称实例,以避免一遍又一遍地显示相同的公司名称。每行都绑定到一个视图模型,从中获取单元格数据。
我可以使用什么来完成此操作,以便单元格可以检查其上方行中同一列中的单元格,如果它是相同的值,则隐藏其自己的值,以免重复相同的公司名称?
I have a radgridview with three columns: Company, Name, Status.
I want to try to prevent repeating instances of the company name when sorted by that column to avoid it showing the same company name over and over and over. Each row is bound to a single viewmodel where it gets its cell data from.
Is there anything I could use to accomplish this, so that a cell can check the cell in the same column in the row above it and if it's the same value, hide its own value so as to not repeat the same company name?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
建议监听
Sorting
或Sorted
事件之一,然后您应该能够以某种方式隐藏数据。如果不出意外的话,我假设您可以使用 CellStyleSelector 将单元格的样式更改为白色背景上的白色文本或类似的内容。然而,可能值得询问 Telerik 自己,因为我认为他们为此类问题提供免费帮助,并且可能有更好的答案。
A suggestion would be to listen out for one of the
Sorting
orSorted
events and then you should be able to hide the data in some way. If nothing else I'd assume that you could use CellStyleSelector change the style of cells to have white text on a white background or something similar.However, it might be worth asking Telerik themselves since I think they offer free help with these kinds of questions and they might have a better answer.