DataView 行 - 按最近修改的顺序排序?
我们正在做的事情 - 我们有一些 DataGrid 绑定到一些 DataView,当用户点击“提交”按钮时,我们希望将所有更改的行传递到 SPROC。这里有一些复杂性,我无法详细说明,但是......
我们需要什么 - 按修改时间排序的已修改行的列表。这可能吗?我怀疑当前的 DataView 类是否可能,所以我想知道我还有什么其他选择?
使用 .NET 4.0
亲切的问候, 河豚
What we're doing - we have some DataGrids bound to some DataViews and when the user hits a 'submit' button we want to pass all the changed rows to a SPROC. There are some complexities here I can't go into detail about but...
what we need - a list of the modified rows ordered by the time they were modified. Is this possible? I doubt it is possible with the current DataView class so I was wondering what other options I have?
Using .NET 4.0
Kind regards,
Fugu
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种方法是手动添加“ModifiedTime”列来保存修改的日期和时间。每次修改行时,通过将其值更新为当前日期和时间来修改“ModifiedTime”列。现在您只需按“ModifiedTime”排序即可获得所需的结果。
One way could be to manually add a column "ModifiedTime" that will hold the modified date and time. Every time a row is modified, modify the "ModifiedTime" column by updating its value to current date and time. Now you can simply sort by "ModifiedTime" to get required results.