Silverlight DataForm 未触发 EditEndedEvent 且未在 AddNewItems 上提交
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现该错误是由于时间戳行的“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).