/// <summary> /// Called when initialized. /// </summary> protected override void OnInitialized() { if (Grid != null) { Grid.AddColumn(this); if (!string.IsNullOrEmpty(FilterProperty) || Type == null) { var property = GetFilterProperty(); if (!string.IsNullOrEmpty(property)) { _filterPropertyType = PropertyAccess.GetPropertyType(typeof(TItem), property); } } if (_filterPropertyType == null) { _filterPropertyType = Type; } else { propertyValueGetter = PropertyAccess.Getter <TItem, object>(Property); } if (_filterPropertyType == typeof(string)) { FilterOperator = FilterOperator.Contains; } } }
private bool IsColumnFilterPropertyTypeString(RadzenDataGridColumn <object> column) { var property = column.GetFilterProperty(); var itemType = Data != null?Data.AsQueryable().ElementType : typeof(object); var type = PropertyAccess.GetPropertyType(itemType, property); return(type == typeof(string)); }
protected bool IsNumeric(string propertyName) { if (String.IsNullOrEmpty(propertyName)) { return(false); } var property = PropertyAccess.GetPropertyType(typeof(TItem), propertyName); if (property == null) { throw new ArgumentException($"Property {propertyName} does not exist"); } return(PropertyAccess.IsNumeric(property)); }