I have a grid where I set the field label background color based on the index of the field. However, when I am scrolling quickly up or down, the background colors of the field labels change and become incorrect. Anybody know why this is happening or know how to avoid this??
Thanks,
-Chris
Hello Chris,
Thank you for your post. I have been looking into your issue and I have not been able to reproduce it. I am attaching my sample application(DataGrid10x2000.zip). Please try to reproduce it or your side and modify the sample if needed. Also it would be great if you can tell us the specific version of the assembly files that you are using like e.g. 12.2.20122.2089.
Looking forward to hearing from you.
I modified the sample you sent me. When I run it and scroll up and down quickly, the label backgrounds change. I'm using assembly version 12.2.20122.1000.
Thank you for your reply. I have been looking into the modified sample application and I was able to reproduce the issue that you have described.. The behavior seems to be caused by the virtualization of the LabelPresenters. Since you are binding the Background to the LabelPresenter itself and since the LabelPresenter are virtualized, the binding is fired once, when the labels are loaded. When you start scrolling the LabelPresenter are reused and a LabelPresenter which was initially used for an Field with index 2 is used for different Field with index 7 for example. Since the LabelPresenter is not reloaded and reinitialized, the binding is not firing and the LabelPresenter is not colored correctly. In order to avoid this behavior you can bind the Background to the Index of the Field corresponding to the LabelPresenter, since it is changed when the LabelPresenter is reused. I have noticed that you are using the XamDataGrid in the converter, in order to bind the Background to the Index and the XamDataGrid, I can suggest using MultiBinding. I have modified the sample application that you have attached, in order to show how you can implement the MultiBinding.
Please let me know if you need any further assistance on the matter.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Any further info on this?