You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 { }
The text was updated successfully, but these errors were encountered: