I have a grid with more records than can be displayed. The first element in the grid is XamCheckEditor. When I scroll away from me, it checks the current record, when I scroll toward me it unchecks the current record. I don't want the scroll wheel changing any data. Is their a property that I'm missing?
Hello curtruffing,
I have been looking into your posts and I can suggest looking through the following forum post where it is explained what exactly the different values of the “RecordContainerGenerationMode” property mean:
http://blogs.infragistics.com/forums/t/48307.aspx
I can suggest using bound field instead of unbound field and setting the ‘SelectedItem’ in the Style for the ‘EditorStyle’ as :
<Setter Property="SelectedItem" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:CellValuePresenter}}, Path=Value }"/>
Also you can use the command in some event like ‘InitializeRecordDirect’:
xamDataGrid.ExecuteCommand(DataPresenterCommands.CommitChangesToAllRecords) to remove the icons that appears when you change the value in a XamComboBox.
Hello air1kdf,
I have been looking into your posts and I can suggest you comment this following two rows, which change the state of the selected XamCheckEditor during scrolling :
Expression.Blend.SampleData.SampleDataSource.ItemCollection collection = (Expression.Blend.SampleData.SampleDataSource.ItemCollection)XamDataGrid1.DataSource;
collection[dataRecord.DataItemIndex].Boolean_Value = Convert.ToBoolean(chk.Value);
If you have any other questions, feel free to ask.
Should have said this works for me. This may well not solve air1kdf’s original issue.
The attached project, Scrolling2.zip, seems to solve the problem of values getting changed when scrolling. The key seems to be the setting
RecordContainerGenerationMode="PreLoad"
However this was causing problems with the way I was binding the ItemsProvider for the XamComboEditor. There are still more value change events than I would expect and I don’t quite understand what was wrong with my original approach, but this works for now.
Apparently the ValueChanged event is being fired even when the value is not changing. This is what’s causing the problem. Is there a work around? Should I open a ticket?