Hello,
I defined a xamdatagrid with these settings:
<igDP:XamDataGrid IsUndoEnabled="True" Name="myDataGridt" OverridesDefaultStyle="False" Grid.Row="1" DataValueChanged="myDataGrid_DataValueChanged" Grid.ColumnSpan="3">
<igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings DataValueChangedNotificationsActive="True" AllowRecordFiltering="True" LabelClickAction="SortByMultipleFields" SummaryDisplayArea="BottomFixed" AllowEdit="False" AllowSummaries="True"/> </igDP:XamDataGrid.FieldSettings>
The datasource is List<> of objects implementing the INotifyPropertyChanged. Every modification in the grid is propagated to the concerned object, keys pressed such as CTRL-Z are efficient to restore modified values but the event DatavalueChanged is not fired.
I tried to force it by code like this:
myDataGrid.FieldLayouts[0].FieldSettings.DataValueChangedNotificationsActive =true; myDataGrid.FieldLayouts[0].FieldSettings.DataValueChangedHistoryLimit = 5;
but it still doesn't work.
Does anybody know?
Hi,
I am glad I was able to help you out. If you don’t require any further assistance on the matter, please verify the thread as answered so it helps othe users as well.
Thanks in advance.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Thank you very much,
The CellUpdated event is the one I needed.
Lionel Mandon
I see what you had in mind, and actually this is the only event that is reserved for changes to the DataSource itself . Of course there is a way for you to achieve your goal. In fact there are numerous events in the XamDataGrid which you can use: CellChanged, CellUpdating, CellUpdates, EditModeEnding, EditModeEnded, RecordUpdating, RecordUpdated. I can also suggest going through our online documentation: http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=xamDataGrid.html in order to get a better understanding of the control and also the difference in the events I mentioned above.
Hope this clarifies things. Please let me know if I can provide you with any further assistance on the matter.
Actually, there is no code to fire the event. I thought that changing values in the datagrid should fire the event. The way you do is working, but it doesn't address my problem. I need to let the user modify datas in the datagrid and fire the event when change occurs to execute additionnals processes .
Which event should I use to manage user's changes in the grid?
Hello Vici,
Since Horen is unavailable right now I had a look at the sample you had attached to the forum thread. On my side everything seems to work ok. Though I did not find any code that should fire the event so I added this snippet to your button’s Click event: ProductList[0].Name = "New value";
Please test this out and let me know if you require any further assistance on the matter.