Here’s my code. It produces a bound grid with the correct number of rows, however the cells are empty.
XAML
<DataGrid
Name="grid"
ItemsSource="{Binding}"
AutoGenerateColumns="True" />
Code behind
grid.DataContext = cn.Query("select * from SomeTable");
From the docs, your syntax there —
cn.Query("sql")— returns a list of dynamic-typed objects (IEnumerable<dynamic>). That won’t work for the DataGrid auto-columns, which looks for concrete members to generate its columns. I’d suggest creating a simple entity class for SomeTable to map the properties and then usingcn.Query<SomeTableEntity>("select * from SomeTable");.