Posted 7 July 2025, 2:05 pm EST - Updated 7 July 2025, 2:13 pm EST
I assign a ValueConverter that returns a Boolean value to a FlexGrid GridColumn but it does not display a checkbox. It only presents True, False or blank as an editable textbox.
Is there another way to Bind a Boolean value to a FlexGrid column so it displays a checkbox?
/// <summary>
/// Converts string = "-1" to true and not "-1" to false
/// Converts back from true to "-1" and false to null
/// </summary>
public class StringToBoolConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
return (string)value == "-1";
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return (bool)value ? "-1" : null;
}
}
<c1:FlexGrid.Columns>
<c1:GridColumn Binding="Remove"
ValueConverter="{StaticResource StringToBoolConverter}"
IsReadOnly="False"
Header="Include?"
Width="100"/>