Пример #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            personasDataSet personasDataSet = ((personasDataSet)(this.FindResource("personasDataSet")));

            // Load data into the table tblpersonas. You can modify this code as needed.
            personasDataSetTableAdapters.tblpersonasTableAdapter personasDataSettblpersonasTableAdapter =
                new personasDataSetTableAdapters.tblpersonasTableAdapter();
            personasDataSettblpersonasTableAdapter.Fill(personasDataSet.tblpersonas);

            tblpersonasViewSource = ((CollectionViewSource)
                                     (this.FindResource("tblpersonasViewSource")));
            //tblpersonasViewSource.View.MoveCurrentToFirst();

            Button_Click(buttonFirst, new RoutedEventArgs());
        }
Пример #2
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            personasDataSet personasDataSet = ((personasDataSet)
                                               (this.FindResource("personasDataSet")));

            personasDataSetTableAdapters.tblpersonasTableAdapter
                personasDataSettblpersonasTableAdapter =
                new personasDataSetTableAdapters.tblpersonasTableAdapter();

            //personasDataSettblpersonasTableAdapter.Insert("Pepe",
            //    "Luis", new DateTime(2000, 12, 2), "333333");
            personasDataSettblpersonasTableAdapter.Insert(apellidoTextBox.Text,
                                                          nombreTextBox.Text, fechaNacimientoDatePicker.DisplayDate,
                                                          documentoTextBox.Text);
            // personasDataSettblpersonasTableAdapter.Update(personasDataSet);
            //personasDataSettblpersonasTableAdapter.Update();
            personasDataSet.AcceptChanges();
            personasDataSettblpersonasTableAdapter.Fill(personasDataSet.tblpersonas);
            //WpfDataGridFrontEnd.personasDataSet personasDataSet = ((WpfDataGridFrontEnd.personasDataSet)(this.FindResource("personasDataSet")));
            // CollectionViewSource.GetDefaultView(personasDataSet).Refresh();
            tblpersonasViewSource.View.MoveCurrentToLast();

            ;
        }