Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
3806
XamGrid - Filters not working well with the ValueConverter
posted

in xamgrid, I have Converter to convert boolean value to yes/No. But the filter row shows default value "Unknown" and does not filter on typing Yes/No in it.

Another problem: Filter row calls converter multiple times (equal to number of records in XamGrid)

public class YesNoConverter : IValueConverter
    {

public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value == null)
return "Unknown";

try
{
if (value is bool)
{
var boolValue = (bool) value;
return boolValue ? "Yes" : "No";
}
return value;
}
catch (Exception)
{
return "Unknown";
}
}