public void ApplyColumns(GroupFilter filter) { _showActive = filter.ShowActive; _showInactive = filter.ShowInactive; gridColumnActiveNumber.Visible = filter.ShowNumber; gridColumnActivePercent.Visible = filter.ShowPercent; if (filter.ShowNumber) advBandedGridViewData.SetColumnPosition(gridColumnActiveNumber, 0, 0); if (filter.ShowPercent) advBandedGridViewData.SetColumnPosition(gridColumnActivePercent, 0, 1); gridColumnInactiveNumber.Visible = filter.ShowNumber; gridColumnInactivePercent.Visible = filter.ShowPercent; if (filter.ShowNumber) advBandedGridViewData.SetColumnPosition(gridColumnInactiveNumber, 0, 0); if (filter.ShowPercent) advBandedGridViewData.SetColumnPosition(gridColumnInactivePercent, 0, 1); advBandedGridViewData.RefreshData(); }
public ContainerControl() { InitializeComponent(); Dock = DockStyle.Fill; _groupFilterControl = new GroupFilter(); _groupFilterControl.FilterChanged += (o, e) => { _totalFilterControl.EnableFilter = _groupFilterControl.EnableFilter; _totalFilterControl.SelectedGroups.Clear(); _totalFilterControl.SelectedGroups.AddRange(_groupFilterControl.SelectedGroups); _totalFilterControl.UpdateDataSource(_groupFilterControl.AllGroups.ToArray(), false); ApplyData(); }; _groupFilterControl.ColumnsChanged += (o, e) => { _totalFilterControl.ShowNumber = _groupFilterControl.ShowNumber; _totalFilterControl.ShowPercent = _groupFilterControl.ShowPercent; }; _totalFilterControl = new TotalFilter(); _totalFilterControl.FilterChanged += (o, e) => { _groupFilterControl.EnableFilter = _totalFilterControl.EnableFilter; _groupFilterControl.SelectedGroups.Clear(); _groupFilterControl.SelectedGroups.AddRange(_totalFilterControl.SelectedGroups); _groupFilterControl.UpdateDataSource(_totalFilterControl.AllGroups.ToArray(), false); ApplyData(); }; _totalFilterControl.ColumnsChanged += (o, e) => { _groupFilterControl.ShowNumber = _totalFilterControl.ShowNumber; _groupFilterControl.ShowPercent = _totalFilterControl.ShowPercent; }; }