protected virtual FilterControlColumn CreateFilterControlColumn(DataColumnInfo columnInfo, CriteriaEditorHelper editorHelper, List <ITestable> testableControls) { FilterControlColumn column = null; ITypeInfo info2; IMemberInfo memberInfo = editorHelper.FilteredTypeInfo.FindMember(columnInfo.Name); if ((memberInfo == null) || !memberInfo.IsVisible) { return(null); } IModelMemberViewItem modelDetailViewItem = this.CreatePropertyEditorModel(memberInfo, out info2); ASPxPropertyEditor testable = this.CreatePropertyEditor(false, modelDetailViewItem, info2, editorHelper.Application, editorHelper.ObjectSpace); if (testable != null) { testable.ViewEditMode = ViewEditMode.Edit; testable.CreateControl(); if (((testable.TestControl != null) && !(testable is ASPxLookupPropertyEditor)) && !SimpleTypes.IsClass(columnInfo.Type)) { testableControls.Add(new TestableUnknownClientIdWrapper(testable)); } } if (testable is ICustomValueParser) { this.valueParsers.Add((ICustomValueParser)testable); } if (testable != null) { this.disposablePropertyEditors.Add(testable); if ((testable is ASPxLookupPropertyEditor) || SimpleTypes.IsClass(columnInfo.Type)) { FilterControlLookupEditColumn column2 = new FilterControlLookupEditColumn { PropertiesLookupEdit = { ObjectSpace = editorHelper.ObjectSpace, ObjectTypeInfo = editorHelper.FilteredTypeInfo, MemberInfo = memberInfo, Model = modelDetailViewItem } }; column2.PropertiesLookupEdit.Model.LookupEditorMode = LookupEditorMode.AllItems; column2.TestCaption = testable.TestCaption; testableControls.Add(new TestableUnknownClientIdWrapper(column2)); column = column2; } else { column = new FilterControlPropertyEditorColumn(memberInfo.MemberType) { PropertiesASPxPropertyEditor = { ASPxPropertyEditor = testable } }; } } if (column == null) { column = this.CreateFilterControlColumnByType(columnInfo.Type); } column.PropertyName = columnInfo.Name.Replace("!", ""); column.DisplayName = CaptionHelper.GetMemberCaption(editorHelper.FilteredTypeInfo, column.PropertyName); return(column); }
private void PopulateColumns(CriteriaEditorHelper editorHelper, List <ITestable> testableControls) { this.valueParsers.Add(new ReadOnlyParametersValueParser()); this.criteriaEdit.Columns.Clear(); foreach (DataColumnInfo info in this.CreateDataColumnInfoList()) { if (!CriteriaPropertyEditorHelper.IgnoredMemberTypes.Contains(info.Type)) { FilterControlColumn column = this.CreateFilterControlColumn(info, editorHelper, testableControls); if (column != null) { this.criteriaEdit.Columns.Add(column); } } } }
private string ConvertPropertyNameToDisplayText(string listFieldName, string fieldName) { FilterControlColumn column = !string.IsNullOrEmpty(listFieldName) ? this.criteriaEdit.Columns[listFieldName] : null; FilterControlColumn column2 = this.criteriaEdit.Columns[fieldName]; if (column2 == null) { return(fieldName); } string displayName = column2.DisplayName; while ((column2 = (FilterControlColumn)((IBoundProperty)column2).Parent) != column) { displayName = column2.DisplayName + '.' + displayName; } return(displayName); }
private string ConvertConstantValueToDisplayText(string listFieldName, string propertyName, string constValue, CriteriaLexerToken constToken) { string str = string.IsNullOrEmpty(listFieldName) ? propertyName : (listFieldName + "." + propertyName); FilterControlColumn column = this.criteriaEdit.Columns[str]; FilterControlLookupEditColumn column2 = column as FilterControlLookupEditColumn; if (column2 == null) { return(constValue); } object editValue = null; if (constToken.CriteriaOperator is OperandValue) { editValue = ((OperandValue)constToken.CriteriaOperator).Value; } if (editValue == null) { return(string.Empty); } ASPxComboBox box = (ASPxComboBox)column2.PropertiesLookupEdit.CreateEdit(new CreateEditControlArgs(editValue, null, null, null, null, EditorInplaceMode.StandAlone, false)); return('\'' + box.Text + '\''); }