Hi all,
I've made the first row of my grid contain comboboxes using a DataTemplateSelector. This works like a charm.
My problem is associated with validation errors when they occur in a cell in a different row. When a cell fails to validate, the cells in the rest of the grid become readonly and non-focusable, or disabled in some fashion, so the focus cannot be changed to a different cell in the grid. However, the comboboxes remain enabled. I want to disable them but cannot find a property in the tree above them to bind to.
I am trying to use something like:
In this example, I am looking to the IsEnabled property on the enclosing GridViewCell but it does not work. I've used Snoop to walk up the tree to the RadGridView to find a property to which I can bind to get the correct behavior. I cannot find a property that changes when there is a validation error in a cell in the grid.
Maybe I'm way off base on this approach. Suggestions would be greatly appreciated.
I've made the first row of my grid contain comboboxes using a DataTemplateSelector. This works like a charm.
My problem is associated with validation errors when they occur in a cell in a different row. When a cell fails to validate, the cells in the rest of the grid become readonly and non-focusable, or disabled in some fashion, so the focus cannot be changed to a different cell in the grid. However, the comboboxes remain enabled. I want to disable them but cannot find a property in the tree above them to bind to.
I am trying to use something like:
const
string
xaml =
"<DataTemplate>"
+
"<ComboBox Tag=\"{0}\" IsEnabled=\"{{Binding Path=IsEnabled, RelativeSource={{RelativeSource FindAncestor, AncestorType=telerik:GridViewCell}}}}\" />"
+
"</DataTemplate>"
;
string
dataTemplateXaml =
string
.Format(xaml, fieldIndex);
In this example, I am looking to the IsEnabled property on the enclosing GridViewCell but it does not work. I've used Snoop to walk up the tree to the RadGridView to find a property to which I can bind to get the correct behavior. I cannot find a property that changes when there is a validation error in a cell in the grid.
Maybe I'm way off base on this approach. Suggestions would be greatly appreciated.