Hello,
I have the following problem:
We have a XamDataGrid with different cells. In one cell is a XamComboEditor to choose different values.
We need now the ability to enable or disable two other cells in the same row depending on the value that is choosen in the combobox (set the allowedit property).
I have tried different things but all I achived was that when I set the field for one row to allowedit, the cells in all rows was editable.
Regards,
Michael
Micheal,
I believe the best way to go here is to handle the grid's EditModeStarting event, and check what field the cell belongs to. If it's one of the fields you wish to potentially disable, then interrogate the value of the determining field (with your combo editor) and cancel the event based on the required value(s) of that combo.
Here's a sample snippet of the event handler:
private void xamDataGrid1_EditModeStarting(object sender, Infragistics.Windows.DataPresenter.Events.EditModeStartingEventArgs e){ if (e.Cell.Field.Name == "Field2" || e.Cell.Field.Name == "Field3") { if (e.Cell.Record.Cells["Field1"].Value == "disable") { e.Cancel = true; } }}Note: This might not work as-is if your combo is an UnboundField, because the Value of that Cell will likely be Null until/unless you interact with the combo, even if it displays a selected value initially.
Does nobody have an answer for this? I really need this.