Показать сообщение отдельно
Старый 22.01.2013, 16:36   #7  
Eloy is offline
Eloy
Участник
 
10 / 17 (1) ++
Регистрация: 28.07.2010
Цитата:
Сообщение от Bergman Посмотреть сообщение
И в итоге будет кастомный фильтр с возможностью маркировки?
В итоге будет lookup со значениями из enum и множественным выбором и возвратом выбранных значений в поле TextBox (txtType).
Чтобы применить фильтр к гриду по кнопке или по событию нужно будет ещё написать код вроде этого:
X++:
        filterObject filter = new filterObject();
        filter.name = "TypeFilter";

        if (this.txtType != null && this.txtType.Text != string.Empty)
        {
            filter.Add(this.filterBranchCondition("Type", this.txtType.Text));
        }

        this.DataSourceView.UserFilter.SetOpenFilter(filter.GetXml());
X++:
    protected virtual conditionType filterBranchCondition(string fieldName, string filterValue)
    {
        conditionType branchCondition = new conditionType();
        branchCondition.status = conditionStatus.open;
        branchCondition.attribute = fieldName;
        branchCondition.value = filterValue;
        branchCondition.@operator = operatorType.eq;
        return branchCondition;
    }
X++:
    private AxDataSourceView dataSourceViewValue;
    protected AxDataSourceView DataSourceView
    {
        get
        {
            if (dataSourceViewValue == null)
                dataSourceViewValue = this.myAxDataSource.GetDataSourceView(myAxGridView.DataMember);

            return dataSourceViewValue;
        }
    }
За это сообщение автора поблагодарили: mazzy (2), perestoronin (1).