WPF DataGrid issue with db40

Posted by Rich Blumer on Stack Overflow See other posts from Stack Overflow or by Rich Blumer
Published on 2010-02-23T04:45:24Z Indexed on 2010/05/18 22:20 UTC
Read the original article Hit count: 541

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about db4o

Related posts about wpf