private bool ShouldGenerateField(Type propertyType, GridView gridView)
{
if (gridView.RenderingCompatibility < VersionUtil.Framework45 && AutoGenerateEnumFields == null)
{
//This is for backward compatibility. Before 4.5, auto generating fields used to call into this method
//and if someone has overriden this method to force generation of columns, the scenario should still
//work.
return(gridView.IsBindableType(propertyType));
}
else
{
//If AutoGenerateEnumFileds is null here, the rendering compatibility must be 4.5
return(DataBoundControlHelper.IsBindableType(propertyType, enableEnums: AutoGenerateEnumFields ?? true));
}
}