Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
560
ValueChanged - newly changed value in ViewModel
posted

I have a simple grid consisting of a checkbox and a name column that serves as a multi-select tool.  Requirements says that whenever the user click a checkbox, the list of all checked items are processed immediately (process is basically a visual refresh of some other lists).

The grid's DataSource is binded to a list in my ViewModel.  When the ValuedChanged event of the checkbox field is fired, the ViewModel's list is not updated yet and result in an incorrect processing (the just-clicked row is not updated in the ViewModel).

What should I do?  Force the updating of the ViewModel's list in my ValueChanged event?

Here's my grid:

 <igDP:XamDataGrid  x:Name="FilteredGrid" DataSource="{Binding FilteredAnimalList}" >

          <igDP:XamDataGrid.FieldLayoutSettings>

            <igDP:FieldLayoutSettings ExpansionIndicatorDisplayMode="Never" AutoGenerateFields="False"   RecordSelectorLocation="None"                     LabelLocation="SeparateHeader" />

          </igDP:XamDataGrid.FieldLayoutSettings>

          <igDP:XamDataGrid.FieldLayouts>

            <igDP:FieldLayout>

              <igDP:FieldLayout.Fields>

                <igDP:Field Name="Status" Label=" " Width="30" x:Name="StatusField" >

                  <igDP:Field.Settings>

                    <igDP:FieldSettings>

                      <igDP:FieldSettings.EditorStyle>

                        <Style TargetType="{x:Type igEditors:XamCheckEditor}">

                          <EventSetter Event="ValueChanged" Handler="StatusField_ValueChanged" />

                        </Style>

                      </igDP:FieldSettings.EditorStyle>

                    </igDP:FieldSettings>

                  </igDP:Field.Settings>

                </igDP:Field>

                <igDP:Field Name="Name" />

              </igDP:FieldLayout.Fields>

            </igDP:FieldLayout>

          </igDP:XamDataGrid.FieldLayouts>

        </igDP:XamDataGrid>

Parents
No Data
Reply
  • 69686
    Verified Answer
    posted

    Hello,

    Try invoking the EndEditMode(...) method of the value editor (XamComboEditor) so that the changes can be pushed back to the underlying object.

Children