开发者

How do I cancel an edit in the Silverlight DataGrid when a validation error has occurred?

I have DataGrid and during a cell edit, a validation error occurs (my binding throws an exception and the error is correctly displayed to the user). The user then chooses to just click somewhere (either to navigate to a different portion of my application or to end the edit) and I want to cancel the edit. However, when there is an active validation error, the开发者_JS百科 data grid refuses to end the edit - this means I cannot manipulate the grid items in any way until the user either enters a valid value or presses the Escape key.

What can I do to programmatically end the edit or is there not way to do it other than to either try and programmatically send the Escape key or programmatically orchestrate value entry to reset the value?


For your instance of the data grid call cancel edit: dataGrid.CancelEdit()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜