db40 的 WPF DataGrid 问题
我使用以下代码使用 db4o OODB 中的项目填充 wpf 数据网格:
IObjectContainer db = Db4oEmbedded.OpenFile(Db4oEmbedded.NewConfiguration(), "C:\Dev\ContractKeeper\Database\ContractKeeper.yap");
var ContractTypes = db.Query(typeof(ContractType));
this.dataGrid1.ItemsSource = ContractTypes.ToList();
这是 XAML:
<Window x:Class="ContractKeeper.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit"
Title="Window1" Height="300" Width="300">
<Grid>
<dg:DataGrid AutoGenerateColumns="True" Margin="12,102,12,24" Name="dataGrid1" />
</Grid>
</Window>
当项目绑定到数据网格时,网格线看起来像有记录,但没有显示数据。有人遇到过 db4o 和 wpf datagrid 的问题吗?
I am using the following code to populate a wpf datagrid with items in my db4o OODB:
IObjectContainer db = Db4oEmbedded.OpenFile(Db4oEmbedded.NewConfiguration(), "C:\Dev\ContractKeeper\Database\ContractKeeper.yap");
var contractTypes = db.Query(typeof(ContractType));
this.dataGrid1.ItemsSource = contractTypes.ToList();
Here is the XAML:
<Window x:Class="ContractKeeper.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit"
Title="Window1" Height="300" Width="300">
<Grid>
<dg:DataGrid AutoGenerateColumns="True" Margin="12,102,12,24" Name="dataGrid1" />
</Grid>
</Window>
When the items get bound to the datagrid, the gridlines appear like there are records but no data is displayed. Has anyone had this issue with db4o and the wpf datagrid?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经解决了我的问题。然而,我并不完全明白发生了什么事。如果我弄清楚了,我会更新这篇文章。
I have resolved my issue. However, I do not entirely understand what was going on. If I figure it out, I will update this post.