DisplayAttribute.AutoGenerateFilter Property    
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that indicates whether filtering UI is automatically displayed for this field.
public:
 property bool AutoGenerateFilter { bool get(); void set(bool value); };public bool AutoGenerateFilter { get; set; }member this.AutoGenerateFilter : bool with get, setPublic Property AutoGenerateFilter As BooleanProperty Value
true if UI should be generated automatically to display filtering for this field; otherwise, false.
Exceptions
An attempt was made to get the property value before it was set.
Examples
The following example shows how to disable the filter for the Employee1 field.
[MetadataType(typeof(EmployeeMD))]  
public partial class Employee {  
    public class EmployeeMD {  
        [Display(Name = "Last Name", Order = -9,   
            Prompt = "Enter Last Name", Description="Emp Last Name")]  
        public object LastName { get; set; }  
        [Display(Name = "Manager", AutoGenerateFilter=false)]  
        public object Employee1 { get; set; }  
    }  
}  
<MetadataType(GetType(EmployeeMD))>  _  
Public Class Employee  
    Public Class EmployeeMD  
        <Display(Name:="Last Name", Order:=-9, _  
           Prompt:="Enter Last Name", Description:="Emp Last Name")>  _  
        Public Property LastName As Object  
        End Property  
        <Display(Name:="Manager", AutoGenerateFilter:=false)>  _  
        Public Property Employee1 As Object  
        End Property  
    End Class  
End Class  
Remarks
Do not use this property to get the value of the AutoGenerateFilter property. Use the GetAutoGenerateFilter method instead.
Setting this property overrides the default behavior for specifying which columns are included as filters.