DataTable comme DataGrid.ItemsSource

salut, je veux lier un DataTable avec plusieurs colonnes à une DataGrid dans le code-behind

    var dt = new DataTable();

    dt.Columns.Add(new DataColumn("1"));
    dt.Columns.Add(new DataColumn("2"));
    dt.Columns.Add(new DataColumn("3"));

    dt.Rows.Add(ff.Mo);
    dt.Rows.Add(ff.Di);
    dt.Rows.Add(ff.Mi);
    dt.Rows.Add(ff.Do);
    dt.Rows.Add(ff.Fr);
    dt.Rows.Add(ff.Sa);
    dt.Rows.Add(ff.So);
//ff is a object that contains List<myCellObj>

DataGrid DGrid = new DataGrid();
for (int i = 0; i < 3; i++)
{
   DataGridTemplateColumn templateColumn = new DataGridTemplateColumn();
   templateColumn.HeaderTemplate = HeaderDt;
   templateColumn.CellTemplate = ItemDt; //specified DataTemplate for myCellObj

   DGrid.Columns.Add(templateColumn);
}

maintenant, comment dois-je régler mes dt comme ItemsSourceDatacontext ou ce que jamais l'obtenir à mon View
aussi si vous pouviez me fournir un moyen de lier directement à mon Object ff

tout ce qui pourrait aide est grandement appréciée

source d'informationauteur WiiMaxx