Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WPF Datagrid SelectionChanged事件和实体框架_Wpf_Entity Framework - Fatal编程技术网

WPF Datagrid SelectionChanged事件和实体框架

WPF Datagrid SelectionChanged事件和实体框架,wpf,entity-framework,Wpf,Entity Framework,在WPF应用程序中,我有一个datagrid,其中包含来自实体框架请求的数据 方法: public static void GetArticlesDisposCommandes(DataGrid dt,string artCodeForms,string artCodeERP) { using (GSUITEEntities dc = new GSUITEEntities()) { dt.ItemsSource = (from a in dc.GCSTOCK

在WPF应用程序中,我有一个datagrid,其中包含来自实体框架请求的数据

方法:

public static void GetArticlesDisposCommandes(DataGrid dt,string artCodeForms,string artCodeERP)
{
    using (GSUITEEntities dc = new GSUITEEntities())
    {
        dt.ItemsSource = (from a in dc.GCSTOCK
                          join b in dc.FICHES_ARTICLES on a.STO_COD_ART equals b.ART_CODE
                          where (b.ART_CODE == artCodeForms || b.ART_CODE == artCodeERP)
                             && !a.STO_NUMPAL.StartsWith("FDR")
                             && a.STO_PICKING != null
                             && a.STO_OUTDATE == null
                             && a.STO_PRECO == 0
                          select new
                             {
                                 a.STO_ID,
                                 b.ART_CODE,
                                 b.ART_LIBELLE1,
                                 a.STO_NUMPAL,
                                 a.STO_PICKING,
                                 a.STO_PNET,
                                 a.STO_DATECONG,
                                 a.STO_DLUO,
                                 a.LOT_ID,
                                 a.STO_LOT1
                             }).ToList();
    }
}
xaml标记: