Цитата:
Сообщение от
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;
}
}