I have an unbound field that is a boolean checkbox. I would like set this value based on something (I would have a method to determine if I should be checked based on some value in a different cell in the same row) either during the initialization of the row or maybe even after all the rows are rendered. It doesn't really matter. Which ever is easier.
Thanks,
Rod Yager
Thank you for posting such an elegant solution!
Hi Rod,
For that particular field define a binding as:
CellValueFormatter foramtter = new CellValueFormatter();
binding.Converter = foramtter;
field.Settings.EditorStyle = new Style(typeof(XamMaskedEditor));
field.Settings.EditorStyle.Setters.Add(new Setter(XamMaskedEditor.ValueProperty, binding));
Define CellValueFormatter as following:
internal sealed class CellValueFormatter : IValueConverter {
public object Convert(object value_, Type targetType_, object parameter_, CultureInfo culture_) { if (value_ != null) { CellCollection cells = value_ as CellCollection;
// Access cell here and return appropriate value. }
}
public object ConvertBack(object value_, Type targetTypes_, object parameter_, CultureInfo culture_) { return null; }}