public string GetItemValue(VeluableObservPointFieldsEnum filter) { var values = new List <string>(); values.Add(Title); if ((filter & VeluableObservPointFieldsEnum.Affiliation) == VeluableObservPointFieldsEnum.Affiliation) { values.Add(Affiliation); } if ((filter & VeluableObservPointFieldsEnum.Type) == VeluableObservPointFieldsEnum.Type) { values.Add(Type); } if ((filter & VeluableObservPointFieldsEnum.Date) == VeluableObservPointFieldsEnum.Date) { values.Add(Dto?.ToString("dd-MM-yyyy")); } return(string.Join(" | ", values.ToArray())); }
private void FilterColumns(VeluableObservPointFieldsEnum filter) { dgvObservationPoints.Columns["Affiliation"].Visible = chckFilterAffiliation.Checked; dgvObservationPoints.Columns["Type"].Visible = chckFilterType.Checked; dgvObservationPoints.Columns["Date"].Visible = chckFilterDate.Checked; }
public void FillObservationPointList(IEnumerable <ObservationPoint> observationPoints, VeluableObservPointFieldsEnum filter) { if (observationPoints.Any()) { var ItemsToShow = observationPoints.Select(i => new ObservPointGui { Title = i.Title, Type = i.Type, Affiliation = i.Affiliation, Date = i.Dto, Id = i.Id }).ToList(); dgvObservationPoints.Rows.Clear(); BindingList <ObservPointGui> observPointGuis = new BindingList <ObservPointGui>(ItemsToShow); dgvObservationPoints.DataSource = observPointGuis; SetDataGridView(); FilterColumns(filter); dgvObservationPoints.Update(); } }