Example #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ShopApp.InventoryDataSet inventoryDataSet = ((ShopApp.InventoryDataSet)(this.FindResource("inventoryDataSet")));
            // Load data into the table Reparts. You can modify this code as needed.
            ShopApp.InventoryDataSetTableAdapters.RepartsTableAdapter inventoryDataSetRepartsTableAdapter = new ShopApp.InventoryDataSetTableAdapters.RepartsTableAdapter();
            inventoryDataSetRepartsTableAdapter.Fill(inventoryDataSet.Reparts);
            System.Windows.Data.CollectionViewSource repartsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("repartsViewSource")));
            repartsViewSource.View.MoveCurrentToFirst();

            // Load data into the table Reparts. You can modify this code as needed.
            ShopApp.InventoryDataSetTableAdapters.RepartsTableAdapter inventoryDataSetRepartsTableAdapters = new ShopApp.InventoryDataSetTableAdapters.RepartsTableAdapter();
            inventoryDataSetRepartsTableAdapter.Fill(inventoryDataSet.Reparts);
            System.Windows.Data.CollectionViewSource repartsViewSources = ((System.Windows.Data.CollectionViewSource)(this.FindResource("repartsViewSource1")));
            repartsViewSource.View.MoveCurrentToFirst();
            // Load data into the table Depots. You can modify this code as needed.
            ShopApp.InventoryDataSetTableAdapters.DepotsTableAdapter inventoryDataSetDepotsTableAdapter = new ShopApp.InventoryDataSetTableAdapters.DepotsTableAdapter();
            inventoryDataSetDepotsTableAdapter.Fill(inventoryDataSet.Depots);
            System.Windows.Data.CollectionViewSource depotsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("depotsViewSource")));
            depotsViewSource.View.MoveCurrentToFirst();

            // Load data into the table Depots. You can modify this code as needed.
            ShopApp.InventoryDataSetTableAdapters.DepotsTableAdapter inventoryDataSetDepotsTableAdapters = new ShopApp.InventoryDataSetTableAdapters.DepotsTableAdapter();
            inventoryDataSetDepotsTableAdapter.Fill(inventoryDataSet.Depots);
            System.Windows.Data.CollectionViewSource depotsViewSources = ((System.Windows.Data.CollectionViewSource)(this.FindResource("depotsViewSource1")));
            depotsViewSource.View.MoveCurrentToFirst();
            // Load data into the table Products. You can modify this code as needed.
            ShopApp.InventoryDataSetTableAdapters.ProductsTableAdapter inventoryDataSetProductsTableAdapter = new ShopApp.InventoryDataSetTableAdapters.ProductsTableAdapter();
            inventoryDataSetProductsTableAdapter.Fill(inventoryDataSet.Products);
            System.Windows.Data.CollectionViewSource productsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("productsViewSource")));
            productsViewSource.View.MoveCurrentToFirst();
        }
Example #2
0
 private void UserControl_Loaded(object sender, RoutedEventArgs e)
 {
     // Do not load your data at design time.
     if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this))
     {
         ShopApp.InventoryDataSet inventoryDataSet = ((ShopApp.InventoryDataSet)(this.FindResource("inventoryDataSet")));
         // Load data into the table Reparts. You can modify this code as needed.
         ShopApp.InventoryDataSetTableAdapters.RepartsTableAdapter inventoryDataSetRepartsTableAdapter = new ShopApp.InventoryDataSetTableAdapters.RepartsTableAdapter();
         inventoryDataSetRepartsTableAdapter.Fill(inventoryDataSet.Reparts);
         System.Windows.Data.CollectionViewSource repartsViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("repartsViewSource")));
         repartsViewSource.View.MoveCurrentToFirst();
         LoadData();
     }
 }