[英]DataGrid refresh after cell edit
I've seen many similar questions regarding the DataGrid, but nothing that directly addresses my situation.我已经看到很多关于 DataGrid 的类似问题,但没有直接解决我的情况。
I need to manually refresh my DataGrid after a cell has been edited.编辑单元格后,我需要手动刷新我的 DataGrid。 The problem is that I cannot figure out when a cell is finished editing.
问题是我无法确定单元格何时完成编辑。 The DataGrid only has a CellEditEnding event (though in SilverLight they provide a CellEditEnded).
DataGrid 只有一个 CellEditEnding 事件(尽管在 SilverLight 中它们提供了一个 CellEditEnded)。 Calling
Refresh()
on my collection view while in CellEditEnding throws an error saying that it's not allowed while a cell is being edited.在 CellEditEnding 中对我的集合视图调用
Refresh()
会引发错误,指出在编辑单元格时不允许这样做。
I need to refresh the entire grid because values in other rows may depend upon the value that was edited.我需要刷新整个网格,因为其他行中的值可能取决于已编辑的值。
If you are referring to the System.Windows.Forms.DataGridView then there is a "CellEndEdit" event or a "CellLeave" or a "CellValueChange" events.如果您指的是 System.Windows.Forms.DataGridView,则存在“CellEndEdit”事件或“CellLeave”或“CellValueChange”事件。
If not please do specify exacly what control you are refering to... WinForm or asp...如果不是,请明确指定您指的是什么控件... WinForm 或 asp...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.