简体   繁体   English

将winforms网格绑定到亚音速类.Net

[英]Binding a winforms grid to subsonic classes .Net

I am trying to bind a winforms grid to a subsonic DB Generated class. 我试图将winforms网格绑定到亚音速DB生成的类。 I come from a ASP.Net background where this works perfectly but when i try to do this using Win Forms it never loads the data and does not allow me to edit or update. 我来自ASP.Net背景,在这里它可以完美地工作,但是当我尝试使用Win Forms进行此操作时,它永远不会加载数据,并且不允许我进行编辑或更新。

Any help would be appreciated. 任何帮助,将不胜感激。

Thanks 谢谢

I have found through trial and error that the best way to do this is to load the data via code in the form load event or any other such event before the data is required. 通过反复试验,我发现最好的方法是在需要数据之前通过表单加载事件或任何其他此类事件中的代码加载数据。

Also once the collection is loaded it should be bound to the data source property of the datasource you are using. 同样,一旦加载了集合,它就应该绑定到您正在使用的数据源的数据源属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM