Hi,
I work wth controls of v.12.1.
XamDataGrid has a checkbox in one of the fields bound to the field in viewmodel. How to make viewmodel updated right after checkbox is checked (not after the the cell lost focus)?
Thanks.
how do you add checkbox to your xam grid ?
Sorry about that, didn't notice the bit about 12.1.
You will have to provide your own style to the XamCheckEditor that the XamDataGrid is using. In the style you will bind the IsChecked property directly to your view model property.
<igDP:Field Name="MyBool"> <igDP:Field.Settings> <igDP:FieldSettings> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamCheckEditor}"> <Setter Property="IsChecked" Value="{Binding Path=DataItem.MyBool, Mode=TwoWay}"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field>
unfortunately, DataItemUpdateTrigger is not available in v12.1 of XamDataGrid.
Can you suggest another solution?
Hi Ilya,
Set the XamDataGrid.FieldSettings.DataItemUpdateTrigger property to "OnCellValueChange".
<igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings DataItemUpdateTrigger="OnCellValueChange"/> </igDP:XamDataGrid.FieldSettings>