1
votes

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?

1
The XAML-Code is missing. Could you add it?Gamlor
I included the XAML code in my post. But how StackOverflow post it back here, the XAML does not show. I don't know why, interesting.Rich Blumer
did you mark the XAML as code? and do you get results from ToList (e.g. debug it or print it to stdout)Karussell

1 Answers

1
votes

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.