public MainWindow() { InitializeComponent(); List <Student> st = StudentService.ReadFile(@"C:\Users\meinik\Documents\students.txt"); DataContext = st; Dropdown.ItemsSource = st; Dropdown.DisplayMemberPath = "ID"; Dropdown.SelectedValuePath = "ID"; }
private void load_Click(object sender, RoutedEventArgs e) { st = StudentService.ReadFile(@"C:\Users\meinik\Documents\students.txt"); DataGrid1.ItemsSource = st; }
public Window1() { InitializeComponent(); st = StudentService.ReadFile(@"C:\Users\meinik\Documents\students.txt"); }