'宣言 Public Property AllowFiltering As AllowFiltering
public AllowFiltering AllowFiltering {get; set;}
'宣言 Public Property AllowFiltering As AllowFiltering
public AllowFiltering AllowFiltering {get; set;}
The grid has an C1FlexGridBase.AllowFiltering property that determines whether columns can be filtered by the user. If that property is set to true, then filters are created automatically for each column based on the setting of the column's AllowFiltering property.
The grid provides condition and value filters. Condition filters allow users to specify conditions such as 'value > 10'. Value filters allow users to select values that should be displayed from a list of values present in the data source. All filters can be customized in code as shown in the examples below.
// initialize "ShipRegion" column filter to show only two values: "AK" and "CA" var col = _flex.Cols["ShipRegion"]; col.AllowFiltering = AllowFiltering.ByValue; var vf = col.Filter as ValueFilter; vf.ShowValues = new object[] { "AK", "CA" }; // initialize "UnitPrice" column filter to show only values greater than $30 col = _flex.Cols["UnitPrice"]; col.AllowFiltering = AllowFiltering.ByCondition; var cf = col.Filter as ConditionFilter; cf.Condition1.Operator = ConditionOperator.GreaterThan; cf.Condition1.Parameter = 30; // apply both column filters to the data _flex.ApplyFilters();