我如何使用 NHibernate、GridControl、BindingSource 进行 CRUD
我的第一次体验通常是 GridControl 和 WinForms。我这样绑定数据: ContactBindingSource.DataSource = sess.Query().ToList(); 这很好用!但下一步是插入、编辑和删除新记录。哪些事件对于处理我的 NHibernate 操作很重要(GridControl 和 BindingSource)。
I make my first experience with the GridControl und WinForms generally. I bind the data this way:
ContactBindingSource.DataSource = sess.Query().ToList();
This works fine! But the next step is to insert, edit and delete new records. Which events are important (GridControl and BindingSource) to handle my NHibernate operation.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,您正在将网格绑定到 BindingSource 组件。如果是这样,最好的解决方案是使用其 ListChanged 事件。这有帮助吗?
As far as I see you are binding the grid to BindingSource component. If so, the best solution for you would be to use its ListChanged event. Does this help?
ListChanged 事件仅由新记录或删除记录触发。我可以使用 CurrentItemChanges,但这不适用于详细信息。而且我有很多细节
the ListChanged event only fires by new records, or delete record. I can use CurrentItemChanges, but this does not work with the details. And I have a lot details