private void UpdateDataGrid() { MainDataGrid.ItemsSource = dataGrid.GetTable(); TextBoxSerch.Focus(); for (int i = 0; i < MainDataGrid.Columns.Count; i++) { MainDataGrid.Columns[i].Header = dataGrid.getHeaders()[i]; } }
private void Search_Click_SelectionChanged(object sender, SelectionChangedEventArgs e) { // Не сносить т.к кнопка не будет работать. Писать логику в ифе var listView = (ListView)sender; if (listView.SelectedItems.Count != 0) { Predicate <object> yourCostumFilter; if (Regions_SearchCombo.SelectedValue != null) { yourCostumFilter = new Predicate <object>(ComplexFilter); } else { yourCostumFilter = new Predicate <object>(item => ((User)item).account_name.Contains(TextBoxSerch.Text)); } MainDataGrid.ItemsSource = dataGrid.GetTable(yourCostumFilter); } listView.UnselectAll(); }
private void UpdateDataGrid() { MainDataGrid.ItemsSource = dataGrid.GetTable(); TextBoxSerch.Focus(); }