public UserControlModifJeux(int id){ InitializeComponent(); taJeux = new teamxboxliveDataSetTableAdapters.jeuxTableAdapter(); dsJeux = new teamxboxliveDataSet.jeuxDataTable(); taJeux.Fill(dsJeux); jeuxId = id; var jeuxQuery = from je in dsJeux where (je.jeux_id == id) select je; dtGridGame.ItemsSource = jeuxQuery.ToArray(); }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { taJeux = new teamxboxliveDataSetTableAdapters.jeuxTableAdapter(); dsJeux = new teamxboxliveDataSet.jeuxDataTable(); taJeux.Fill(dsJeux); if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) { //Chargez vos données ici et assignez le résultat à CollectionViewSource. System.Windows.Data.CollectionViewSource myCollectionViewSource = (System.Windows.Data.CollectionViewSource)this.Resources["Resource Key for CollectionViewSource"]; cboJeux.ItemsSource = dsJeux; } }