protected object FilterItemOnProperty (object item, string field)
{
if (item == null)
return null;
if (field == null || field == string.Empty)
return item;
PropertyDescriptor prop = null;
if (data_manager != null) {
PropertyDescriptorCollection col = data_manager.GetItemProperties ();
prop = col.Find (field, true);
} else {
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (item);
prop = properties.Find (field, true);
}
if (prop == null)
return item;
return prop.GetValue (item);
}