private object GetObjectValue(object value) { var type = value.GetType(); if (!type.IsSerializable) { return("Non Serializable Value"); } if (ListUtil.IsComplexType(type)) { var sb = new StringBuilder(); var pDesc = TypeDescriptor.GetProperties(value); foreach (PropertyDescriptor pd in pDesc) { sb.Append(string.Format("{0} : {1}, ", pd.Name, pd.GetValue(value))); } return(sb.ToString()); } //WPF-28414 if cell value is enum type then we must convert it to string. if (type.IsEnum) { return(value.ToString()); } return(value); }