How to detect that unbound column has changed and based on that enable or disable combo
I guess that would depend on what your unbound column is. If your unbound column is just a free standing control, you could attach to the controls ValueChanged event (like a checkbox IsChecked event) and then toggle your secondary control.
Its checkbox in the xamgrid
Will it be the valuechanged event?
A checkbox has 3 events, you would have to add a handler for all of them.
<
>
Changed the checkboxcolumn to template column and checkbox is not disabled any more
But when i click on checkbox the dropdown does not enable or disable
Thanks Darrell for the help
I have got it working partial
I have got the controls to work the way they are supposed to but they appear to be disabled
In partial calss I have
public Boolean IsComboEnabled { get { Boolean field1= true; if (null!=this.field2) { field1= false; } return field1; } }
In the xaml its as
<ig:CheckBoxColumn x:Name="xxxCheckbox" HeaderText="xxx" Key="IsComboEnabled"></ig:CheckBoxColumn>
How to assign combo enabled property to checkbox?
The best way would be to have a field on your data object provide the information to the control. If you added a property "IsComboEnabled" on your data object which would be set from your initial configuration, you could use a bound checkbox to the field, and in your item template for the combobox column bind the IsEnabled property of the combo to the IsComboEnabled property of the data object.
Then when you changed the checkbox the bindings woudl do all the work.
I have columnX as column from db (This is displayed as a dropdown in the UI)and ColumnY as unboundColumn
If the value of columnX is not null in db(UI has the dropdown as disabled) , the unboundcolumn(checkbox) set as unchecked (Here i am using valueconverter)
If the vaue is columnX is null, unboundcolumn is set as checked (UI has drodpwon with columnX as enabled)
This works fine
Now If the user unchecks/checks the unboundcolumn in the UI, dropdown should be enabled or disabled)
How are you determing on initial load if the combo in your column should be enabled or not?
Are you binding the combo's IsEnabled to a property on your object model? If you are doing that, then you shoud bind your checkbox to the property that controls the IsEnabled flag.
Please explain what you are doing, because the solution that fits or that I might propose may not be the best for your setup.