private void SelectColumns() { var columns = new Dictionary <string, bool>(); foreach (var c in eventView.Columns) { columns.Add(c.Fieldname, c.VisibleIndex >= 0); } var cs = new Dialogs.ColumnSelector(columns, "Name"); var result = cs.ShowDialog(); if (result == DialogResult.OK) { columns = cs.GetColumnValues(); foreach (var c in columns) { var col = eventView.Columns[c.Key]; if (col == null) { continue; } if (!c.Value && col.VisibleIndex >= 0) { eventView.Columns.SetVisibleIndex(col, -1); } else if (c.Value && col.VisibleIndex < 0) { eventView.Columns.SetVisibleIndex(col, eventView.Columns.VisibleColumns.Length); } } } }
private void SelectColumns() { var columns = new Dictionary<string, bool>(); foreach (var c in eventView.Columns) columns.Add(c.Fieldname, c.VisibleIndex >= 0); var cs = new Dialogs.ColumnSelector(columns, "Name"); var result = cs.ShowDialog(); if (result == DialogResult.OK) { columns = cs.GetColumnValues(); foreach (var c in columns) { var col = eventView.Columns[c.Key]; if (col == null) continue; if (!c.Value && col.VisibleIndex >= 0) eventView.Columns.SetVisibleIndex(col, -1); else if (c.Value && col.VisibleIndex < 0) eventView.Columns.SetVisibleIndex(col, eventView.Columns.VisibleColumns.Length); } } }