private void FrmAnbarGroup_Load(object sender, EventArgs e) { Set_Data(); var accounts = AnbarGroupBussines.GetAll().ToList(); AutoCompleteStringCollection _source = new AutoCompleteStringCollection(); foreach (var item in accounts) { _source.Add(item.Name); } txtName.AutoCompleteMode = AutoCompleteMode.SuggestAppend; txtName.AutoCompleteSource = AutoCompleteSource.CustomSource; txtName.AutoCompleteCustomSource = _source; }
public void LoadData(string search = "") { try { if (search == "") { var lst = AnbarGroupBussines.GetAll().Where(q => q.Status).OrderBy(q => q.Name).ToList(); AnbarGroupBindingSource.DataSource = lst.ToList(); } else { var list = AnbarGroupBussines.Search(search).Where(q => q.Status).OrderBy(q => q.Name).ToList(); AnbarGroupBindingSource.DataSource = list; } lblCounter.Text = AnbarGroupBindingSource.Count.ToString(); } catch (Exception exception) { frmMessage frm = new frmMessage(EnumMessageFlag.ShowFlag, Color.Red, exception.Message); frm.ShowDialog(); } }
private void LoadGroups() { var lst = AnbarGroupBussines.GetAll().OrderBy(q => q.Name).ToList(); cmbGroup.DataSource = lst; }