I've got a boolean/checkbox. When my user checks or unchecks the box, I need to make other changes in the UI based upon the new value. But the value isn't immediately changed. It only changes after the user clicks on another cell, which fired the OnEditModeEnding event.
How do I get around this issue so that I can immediately update my UI without waiting for the OnEditMOdeEnding event.
I'm using MVVM. The backing model is wired up for INotifyPropertyChanged. Everything works post-OnEditModeEnding. I've tried overriding the cell presenter style to a basic checkbox with 'UpdateSourceTrigger=PropertyChanged'. We're on 13.1, but I can upgrade to 14.2 during my next sprint.
Suggestions?
Thx,
Ivan
Hi Ivan,
Thank you for your reply. I am glad that you have managed to resolve your issue.
This works for the XamComboEditor issue.
<igDp:Field Name="FieldName" Label="Field Name" >
<igDp:Field.Settings>
<igDp:FieldSettings AllowHiding="Never" EditorType="{x:Type editors:XamComboEditor}" >
<igDp:FieldSettings.EditorStyle>
<Style TargetType="{x:Type editors:XamComboEditor}">
<Setter Property="ItemsSource" Value="{Binding Path=DataContext.AvailableFieldNames, Source={StaticResource Spy}, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" />
<Setter Property="SelectedItem" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<EventSetter Event="SelectedItemChanged" Handler="OnValueChangedHandler" />
</Style>
</igDp:FieldSettings.EditorStyle>
</igDp:FieldSettings>
</igDp:Field.Settings>
</igDp:Field>
--
private void OnValueChangedHandler(object sender, RoutedPropertyChangedEventArgs<object> e)
{
var editor = sender as ValueEditor;
if (editor == null)
return;
editor.EndEditMode(true, true);
e.Handled = true;
}
That syntax isn't available in 13.1. I tried DataValueChangedNotificationsActive="True" without success.
I think I figured it out using this solution.
http://ko.infragistics.com/community/forums/t/77040.aspx
Now I'm dealing with the same issue in a combobox. The ValueChanged solution doesn't work in that situation.
Any suggestions?
Thank you for contacting Infragistics. I have been looking into your requirement and I can suggest you set the ‘DataItemUpdateTrigger’ property of the FieldSetting of the XamDataGrid to “OnCellValueChange”. For more information:
http://help.infragistics.com/Help/Doc/WPF/2014.2/CLR4.0/html/InfragisticsWPF4.DataPresenter.v14.2~Infragistics.Windows.DataPresenter.DataItemUpdateTrigger.html
Let me know, if you need any further assistance on this matter.