private void VulDeGrid() { brouwerViewSource = ((CollectionViewSource)(this.FindResource("brouwerViewSource"))); var manager = new BrouwerManager(); brouwersOb = manager.GetBrouwersBeginNaam(textBoxZoeken.Text); brouwerViewSource.Source = brouwersOb; goUpdate(); labelTotalRowCount.Content = brouwerDataGrid.Items.Count - 1; brouwersOb.CollectionChanged += this.OnCollectionChanged; }
private void VulDeGrid() { brouwerViewSource = ((CollectionViewSource)(this.FindResource("brouwerViewSource"))); // Load data by setting the CollectionViewSource.Source property: // brouwerViewSource.Source = [generic data source] var manager = new BrouwerManager(); brouwersOb = manager.GetBrouwersBeginNaam(textBoxZoeken.Text); brouwerViewSource.Source = brouwersOb; labelTotalRowCount.Content = brouwerDataGrid.Items.Count; brouwersOb.CollectionChanged += this.OncollectionChanged; GoUpdate(); }
//methods private void VulDeGrid() { int totalRowsCount; brouwerViewSource = ((CollectionViewSource)(this.FindResource("brouwerViewSource"))); var manager = new BrouwerManager(); brouwersOb = manager.GetBrouwersBeginNaam(textBoxZoeken.Text); totalRowsCount = brouwersOb.Count(); labelTotalRowCount.Content = totalRowsCount.ToString(); brouwerViewSource.Source = brouwersOb; goUpdate(); var nummers = (from b in brouwersOb orderby b.Postcode select b.Postcode.ToString()).Distinct().ToList(); nummers.Insert(0, "alles"); comboBoxPostcode.ItemsSource = nummers; comboBoxPostcode.SelectedIndex = 0; }
private void VulDeGrid() { try { brouwerViewSource = (CollectionViewSource)(this.FindResource("brouwerViewSource")); var manager = new BrouwerManager(); BrouwerOb = manager.GetBrouwersBeginNaam(TextBoxZoeken.Text); int TotalRowCount; TotalRowCount = BrouwerOb.Count(); LabelTotalRowCount.Content = TotalRowCount; brouwerViewSource.Source = BrouwerOb; BrouwerOb.CollectionChanged += this.OnCollectionChanged; goUpdate(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }