我正在使用以下代码用我的 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 数据网格有过这个问题吗?