public KurseviEditWindow(Kurs k, MOD m = MOD.DODAVANJE) : this() { this.original = k; this.mod = m; this.copyObj = original.Clone() as Kurs; this.DataContext = copyObj; cvs = new CollectionViewSource(); cvs.Source = original.Ucenici; dgUcenici.ItemsSource = cvs.View; dgUcenici.IsReadOnly = true; dgUcenici.SelectionMode = DataGridSelectionMode.Single; dgUcenici.AutoGenerateColumns = false; DataGridTextColumn c = new DataGridTextColumn(); c.Header = "Ime"; c.Binding = new Binding("Ime"); c.Width = new DataGridLength(1, DataGridLengthUnitType.Star); dgUcenici.Columns.Add(c); c = new DataGridTextColumn(); c.Header = "Prezime"; c.Binding = new Binding("Prezime"); c.Width = new DataGridLength(1, DataGridLengthUnitType.Star); dgUcenici.Columns.Add(c); }
public UceniciKursa(Kurs k) : this() { this.original = k; this.copyObj = original.Clone() as Kurs; this.DataContext = copyObj; cvsSviUcenici = new CollectionViewSource(); cvsSviUcenici.Source = Aplikacija.Instanca.Ucenici; dgSviUcenici.ItemsSource = cvsSviUcenici.View; dgSviUcenici.IsReadOnly = true; dgSviUcenici.SelectionMode = DataGridSelectionMode.Single; dgSviUcenici.AutoGenerateColumns = false; DataGridTextColumn c = new DataGridTextColumn(); c.Header = "Ime"; c.Binding = new Binding("Ime"); c.Width = new DataGridLength(1, DataGridLengthUnitType.Star); dgSviUcenici.Columns.Add(c); c = new DataGridTextColumn(); c.Header = "Prezime"; c.Binding = new Binding("Prezime"); c.Width = new DataGridLength(1, DataGridLengthUnitType.Star); dgSviUcenici.Columns.Add(c); cvsUceniciKursa = new CollectionViewSource(); cvsUceniciKursa.Source = original.Ucenici; dgUceniciKursa.ItemsSource = cvsUceniciKursa.View; dgUceniciKursa.IsReadOnly = true; dgUceniciKursa.SelectionMode = DataGridSelectionMode.Single; dgUceniciKursa.AutoGenerateColumns = false; DataGridTextColumn c1 = new DataGridTextColumn(); c1.Header = "Ime"; c1.Binding = new Binding("Ime"); c1.Width = new DataGridLength(1, DataGridLengthUnitType.Star); dgUceniciKursa.Columns.Add(c1); c1 = new DataGridTextColumn(); c1.Header = "Prezime"; c1.Binding = new Binding("Prezime"); c1.Width = new DataGridLength(1, DataGridLengthUnitType.Star); dgUceniciKursa.Columns.Add(c1); }
public KursIzmena(Kurs k, MOD m = MOD.DODAVANJE) : this() { if (mod == MOD.DODAVANJE) { dpDatumPocetak.Text = DateTime.Now.Date.ToString(); // dpDatumKraj.SelectedDate.Value = DateTime.Today; } this.original = k; this.copyObj = (Kurs)original.Clone(); this.mod = m; this.DataContext = copyObj; if (mod == MOD.IZMENA) { cbJezik.IsEnabled = false; cbTip.IsEnabled = false; } if (mod == MOD.DODAVANJE) { dpDatumPocetak.SelectedDate = DateTime.Now; dpDatumKraj.SelectedDate = DateTime.Now; } }