Silverlight DataForm 未触发 EditEndedEvent 且未在 AddNewItems 上提交

发布于 2024-10-05 06:48:38 字数 325 浏览 0 评论 0原文

我有一个 Silverlight 用户控件。其中包含一个带有只读、编辑和新建模板的数据表单。

模板模式运行良好,编辑表单运行良好。但是当我使用 AddNewItem 时,我无法执行所有操作,除了它从未调用 EditEnded 事件,但是它调用 EditEnding 并且此后丢失且没有任何警告。

我在新模式下使用 Datacontext.CommitEdit 进行提交。如果没有错误并且 DataContext 有任何更改,则假设触发 EditEnded 并执行 SubmitChanges。由于逻辑不在 EditEnded 内部,所以我无能为力。

如果我能得到一些建议,那将会很有帮助。

I have a Silverlight User Control. This contains a DataForm with templates for ReadOnly, Edit, and New.

The template mode are working well and editing form are working perfectly. but when i use AddNewItem, I cannot do all the things except it never called EditEnded event, However it calls EditEnding and it lost without any warning after that.

I used Datacontext.CommitEdit for commit while in New mode. Which then suppose to trigger EditEnded and do SubmitChanges if there are no errors and if DataContext has any changes. Since the logic is not going inside EditEnded I could not do anything.

It would be helpful, if I could get some suggestion.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

肩上的翅膀 2024-10-12 06:48:38

我发现该错误是由于时间戳行的“NOT NULL”属性导致数据库中出现异常。我通过将模型(实体模型)中的时间戳行更改为“NOT NULL”来解决它。

I have found the error was because of exception in database due to "NOT NULL" property for TimeStamp row. I solved it by changing TimeStamp row to "NOT NULL" in models (entity models).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文