sql - DataGrid with small rows and no data after binding to the ItemSource with LINQ query -
i'm new linq , wpf , i'm trying bind custom query linq , rows barely appear although when debugging ienumerable<ordersummary> ordersummary
has info in it. believe empty rows showing amount of rows returned query:
xaml:
<datagrid name="dgrorders" margin="59,54,161,285" />
code behind:
orderitdataclassesdatacontext dc = new orderitdataclassesdatacontext(); ienumerable<ordersummary> ordersummary = dc.executequery<ordersummary>("select * [order]",1); dgrorders.itemssource = ordersummary; public class ordersummary { int orderid { get; set; } datetime orderdate { get; set; } int customerid { get; set; } }
i suppose should use properties instead of fields. check examples on msdn
public class ordersummary { public int orderid { get; set; } public datetime orderdate { get; set; } public int customerid { get; set; } }
the second thing may try - specify dgrorders datacontext
, not itemsource
.
Comments
Post a Comment