向DataView添加新行并保持现有排序? [英] Add new row to DataView and keep existing sorting?

查看:69
本文介绍了向DataView添加新行并保持现有排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从DataTable中提取的现有DataView。有时我需要向DataView添加一个新行,但是我需要在行集的末尾添加该行,但是要在创建DataView时遵循现有的Sort属性。
这可能吗?或者我必须重新创建DataView以正确排序行吗?

I have an existing DataView, extracted from a DataTable. Sometimes I need to add a new row to that DataView, but I need that row to be added not at the end of the row set, but so that it follows the existing Sort property from when the DataView was created. Is this at all possible? Or must I to recreate the DataView to order the rows correctly?

推荐答案

当然......只需将新行添加到DataView或DataTable即可。无论哪种方式,它都应该正确地保持排序顺序。你试过吗?

Sure ... just add the new row to either the DataView or the DataTable. Either way, it should keep the sort order correctly. Have you tried it?


这篇关于向DataView添加新行并保持现有排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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