If one field of the grid is an enum, if you filter you get an error,
I added this code to change the enums to their correct values, i could be done inside the library
private static void UpdateFilter(Filter filter)
{
if(filter==null)
{
return;
}
if (filter.Field != null)
{
var campo = filter.Field.Split('.');
var val = filter.Value;
var type = typeof(T);
foreach (var c in campo)
{
type = type.GetProperty(c).PropertyType;
}
if (type.IsEnum)
{
val = val ?? "0";
try
{
var enumVal = Enum.Parse(type, val.ToString());
filter.Value = enumVal;
}
catch { }
If one field of the grid is an enum, if you filter you get an error,
I added this code to change the enums to their correct values, i could be done inside the library
private static void UpdateFilter(Filter filter)
{
if(filter==null)
{
return;
}
if (filter.Field != null)
{
var campo = filter.Field.Split('.');
var val = filter.Value;
var type = typeof(T);
foreach (var c in campo)
{
type = type.GetProperty(c).PropertyType;
}
if (type.IsEnum)
{
val = val ?? "0";
try
{
var enumVal = Enum.Parse(type, val.ToString());
filter.Value = enumVal;
}
catch { }