Hi Andrew,
Sorry for my late reply , It took me a little longer to verify the issue.
It worked perfectly though ,
Thanks for the help.
Hello Gottfried,
Thank you for your post.
I have been investigating into the sample project that you have sent, and the reason that you are not seeing the image shown immediately, but you are when scrolling out of view and then back into view has to do with the binding on your converter and the virtualization of the cells in the XamDataGrid. Essentially, when cells go out of view, the CellValuePresenter that "presents" those cells is virtualized, and is therefore null. Now, you have your converter bound directly to "DataItem," and when this cell goes out of view and its presenter gets virtualized, this DataItem property no longer really exists at the scope of any of the CellValuePresenters in the grid. When you scroll the record back into view, the CellValuePresenter exists again, and so the DataItem is assigned and the converter fires, which shows your image.
The above is the reason why you are seeing your image when scrolling away and then back to your row. The reason you are not seeing it immediately is because of the binding directly to DataItem. When you change a specific property on your DataItem, the instance of that DataItem never really changes, but the properties on it do. Since the DataItem itself isn't never actually changes, the converter never fires, and so you do not see your item.
To resolve this, I would recommend that instead of only binding to DataItem, that you bind your Image's Visibility to a MultiBinding with an IMultiValueConverter. This will allow you to bind to multiple elements and retrieve them from your converter when the converter fires, which will be whenever one of these elements changes. I would recommend continuing to bind to DataItem for one of these bindings, as you want it in the converter, but for the other binding, I would recommend binding to the Value property of the CellValuePresenter that the image sits inside. In the case of your sample project, you will see that since the Value of your cell is changing, that this makes the converter fire, and so you will see your image immediately.
I have attached a modified version of the sample project you had sent me to demonstrate the above. I hope this helps you.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support