protected override void OnViewChange() { base.OnViewChange(); _inLabelEdit = false; availableFieldsTreeColumns.ViewEditor = ViewEditor; availableFieldsTreeColumns.RootColumn = ViewInfo.ParentColumn; availableFieldsTreeColumns.SublistId = ViewInfo.SublistId; availableFieldsTreeColumns.CheckedColumns = ListColumnsInView(); IList <DisplayColumn> gridColumns = ImmutableList.ValueOf(ViewEditor.ViewInfo.DisplayColumns.Where(col => !col.ColumnSpec.Hidden)); if (gridColumns.Count != VisibleColumns.Count) { gridColumns = VisibleColumns; } ListViewHelper.ReplaceItems(listViewColumns, gridColumns.Select(MakeListViewColumnItem).ToArray()); if (null != SelectedPaths) { var selectedIndexes = VisibleColumns .Select((col, index) => new KeyValuePair <DisplayColumn, int>(col, index)) .Where(kvp => SelectedPaths.Contains(kvp.Key.PropertyPath)) .Select(kvp => kvp.Value); ListViewHelper.SelectIndexes(listViewColumns, selectedIndexes); } UpdateButtons(); }
protected override void OnViewChange() { base.OnViewChange(); _inLabelEdit = false; availableFieldsTreeColumns.RootColumn = ViewInfo.ParentColumn; availableFieldsTreeColumns.ShowAdvancedFields = ViewEditor.ShowHiddenFields; availableFieldsTreeColumns.SublistId = ViewInfo.SublistId; availableFieldsTreeColumns.CheckedColumns = ListColumnsInView(); ListViewHelper.ReplaceItems(listViewColumns, VisibleColumns.Select(MakeListViewColumnItem).ToArray()); if (null != SelectedPaths) { var selectedIndexes = VisibleColumns .Select((col, index) => new KeyValuePair<DisplayColumn, int>(col, index)) .Where(kvp => SelectedPaths.Contains(kvp.Key.PropertyPath)) .Select(kvp => kvp.Value); ListViewHelper.SelectIndexes(listViewColumns, selectedIndexes); } UpdateButtons(); }