private void Window_Loaded(object sender, RoutedEventArgs e) { timerStart(); WpfApp1.marathonDataSet marathonDataSet = ((WpfApp1.marathonDataSet)(this.FindResource("marathonDataSet"))); // Загрузить данные в таблицу Charity. Можно изменить этот код как требуется. WpfApp1.marathonDataSetTableAdapters.CharityTableAdapter marathonDataSetCharityTableAdapter = new WpfApp1.marathonDataSetTableAdapters.CharityTableAdapter(); marathonDataSetCharityTableAdapter.Fill(marathonDataSet.Charity); System.Windows.Data.CollectionViewSource charityViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("charityViewSource"))); charityViewSource.View.MoveCurrentToFirst(); }
private void Window_Loaded(object sender, RoutedEventArgs e) { timerStart(); WpfApp1.marathonDataSet marathonDataSet = ((WpfApp1.marathonDataSet)(FindResource("marathonDataSet"))); // Загрузить данные в таблицу Charity. Можно изменить этот код как требуется. WpfApp1.marathonDataSetTableAdapters.CharityTableAdapter marathonDataSetCharityTableAdapter = new WpfApp1.marathonDataSetTableAdapters.CharityTableAdapter(); marathonDataSetCharityTableAdapter.Fill(marathonDataSet.Charity); marathonDataSetCharityTableAdapter.SerchID(marathonDataSet.Charity, Perem.CharityID); System.Windows.Data.CollectionViewSource charityViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("charityViewSource"))); charityViewSource.View.MoveCurrentToFirst(); LogoImg.Source = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + charityLogoTextBox.Text, UriKind.Absolute)); charityLogoTextBox.Text = ""; }
private void Details_Click(object sender, RoutedEventArgs e) { for (var vis = sender as Visual; vis != null; vis = VisualTreeHelper.GetParent(vis) as Visual) { if (vis is DataGridRow) { Libra.Charity charity = new Libra.Charity(); var Selectedsell = this.charityDataGrid.Columns[0].GetCellContent(this.charityDataGrid.SelectedItem); string Cell = Selectedsell.Parent.ToString(); string koll = "System.Windows.Controls.DataGridCell: "; Cell = Cell.Remove(0, koll.Length); Cell = Cell.Replace(" ", ""); Perem.CharityID = Convert.ToInt32(Cell); AddOrEditCharity addOrEditCharity = new AddOrEditCharity(); addOrEditCharity.ShowDialog(); WpfApp1.marathonDataSet marathonDataSet = ((WpfApp1.marathonDataSet)(this.FindResource("marathonDataSet"))); // Загрузить данные в таблицу Charity. Можно изменить этот код как требуется. WpfApp1.marathonDataSetTableAdapters.CharityTableAdapter marathonDataSetCharityTableAdapter = new WpfApp1.marathonDataSetTableAdapters.CharityTableAdapter(); marathonDataSetCharityTableAdapter.Fill(marathonDataSet.Charity); } } }