When I am using the datagrid and enter a value in a cell and click save the value I just entered is lost. Only when I move focus into another cell will the value get saved.
I tried setting the updatesourcetrigger=Propertychanged also but still it's not working . I have written the code below:
<
Controls1:LipperGrid GroupByAreaLocation="None" Margin="0" Width="580" BorderThickness="0" AutoFit="False" HorizontalAlignment="Stretch" DataSource="{Binding PSNDCAssetAllocation}" Theme="Office2k7Silver" x:Name="lstNonDCAssets1" CellUpdated="lstNonDCAssets1_CellUpdated" CellUpdating="lstNonDCAssets1_CellUpdating" EditModeValidationError="lstNonDCAssets1_EditModeValidationError">
<DataPresenter:FieldSettings AllowEdit="False" LabelClickAction="Nothing" CellWidth
="200" />
</DataPresenter:Field
>
<DataPresenter:Field Name="Value" Label
="Assets value in %">
<DataPresenter:Field.Settings
<DataPresenter:FieldSettings CellWidth="20" LabelClickAction="Nothing" EditorType="{x:Type igEditors:XamTextEditor}" AllowEdit="True" CellClickAction
="EnterEditModeIfAllowed">
<DataPresenter:FieldSettings.EditorStyle
<Style TargetType="{x:Type igEditors:XamTextEditor
}">
<Style.Setters
<Setter Property="ValueType" Value="{x:Type sys:Decimal
}"/>
<Setter Property="Format" Value
="######0.###"/>
<Setter Property="HorizontalAlignment" Value
="Center"/>
</Style.Setters
</Style
</DataPresenter:FieldSettings.EditorStyle
</DataPresenter:FieldSettings
</DataPresenter:Field.Settings
<DataPresenter:Field Name="ModDate" Label
="Last Modified Date" >
="20"/>
<DataPresenter:Field Name="ModUser" Label
="Last Modified By" >
</DataPresenter:FieldLayout.Fields
</DataPresenter:FieldLayout
</Controls1:LipperGrid.FieldLayouts
</Controls1:LipperGrid
Hello,
This is because the Editor in that cells updates the underlying data object when it ends edit mode. By default, the edit mode ends when the editor loses focus. If you want the data to be updated immediately, when clicking the Save Button, you have to call EndEditMode(...) method of the ValueEditor of that cell.
Please let me know if you have any more questions on this.
Save button is in different file. How I should set set the EndEditMode explicitly? Save button is common for six screens. Each screen has grid and I am facing the same issue in all grids