Guys,I discovered (by accident) that I don't appear to have completely turned off the 'Virtualization' feature in the XamDataGrid. Below is an excerpt from my code where I am setting up the grid. In the <FieldSettings> I have set 'AllowCellVirtualization' to false, which seemed to have worked when I scrolled the horizontal scrollbar left and right. However, I found out today that my CellValuePresenter object customizations are being lost when I scroll the vertical scrollbar up and down.Just to clarify what I'm doing: I have an event handler on the CellUpdated event that sets the background color for a CellValuePresenter based on some condition of the cell data. But as I mentioned, some cells are showing the change to the background color just because I'm scrolling vertically.Here is the grid code:
<igDP:XamDataGrid Grid.Row="0" Name="dataGrid" Margin="0,0,0,0" Theme="Aero" GroupByAreaLocation="None" FieldLayoutInitialized="dataGrid_FieldLayoutInitialized" CellUpdated="dataGrid_CellUpdated"> <igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings AllowCellVirtualization="False" /> </igDP:XamDataGrid.FieldSettings> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="True" AllowDelete="False" /> </igDP:XamDataGrid.FieldLayoutSettings></igDP:XamDataGrid>Am I missing something or is this a bug?Thanks in advance for any help/clarification you are able to provide.
Hello,
The record virtualization (which is when you are scrolling vertically) is controlled by the RecordContainerGenerationMode property of the XamDataGrid. You can turn if off by setting it to PreLoad. This way your DataRecordPresenters will be generated when the XamDataGrid loads and will not be virtualized.
Alex,That seems to work, sort of. When I grab the scrollbar and scroll it to the bottom, the entire app freezes. I'll look into it some more on my side just to make sure it's not my code.I do have an additional question that is related to this topic and that I think might help other people working through the same issue. Instead of turning off all virtualization, I opted to try the opposite way and see if I could make use of it. I read in another post about a XamDataGrid.InitializeCellValuePresenter event that gets fired whenever a CellValuePresenter is needed for a Cell. However, I could not get it to fire. Is there some special magic required to make this event fire that I'm missing?<igDP:XamDataGrid Grid.Row="0" Name="dataGrid" Margin="0,0,0,0" Theme="Aero" GroupByAreaLocation="None" FieldLayoutInitialized="dataGrid_FieldLayoutInitialized" CellUpdated="dataGrid_CellUpdated" InitializeCellValuePresenter="dataGrid_InitializeCellValuePresenter">Thanks again in advance for any advice you can give on this!
Never mind. I went back through the documentation and found the answer:"This event is only raised for Infragistics.Windows.DataPresenter.CellValuePresenters associated with a Infragistics.Windows.DataPresenter.Field whose FieldSettings.DataValueChangedNotificationsActive property has been set to true."
Hi,
I'm doing exactly the same thing. However, I can't get this event fired when horizontally scrolling to a previous view. It seems that all those previously loaded CVPs are cached. It works fine when I'm scrolling vertically. Please help, thanks.
Cheers,
Daniel