System.Web.UI.WebControls.GridView.IsBindableType C# (CSharp) Method

IsBindableType() public method

public IsBindableType ( Type type ) : bool
type Type
return bool
		public virtual bool IsBindableType (Type type)
		{
			return type.IsPrimitive || type == typeof (string) || type == typeof (decimal) || type == typeof (DateTime) || type == typeof (Guid);
		}
		

Usage Example

 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));
     }
 }
All Usage Examples Of System.Web.UI.WebControls.GridView::IsBindableType