Posted 29 June 2020, 12:53 pm EST
Hi KP,
You’re right this is because of the recycling. In order to recycle cells correctly you must override GetCellContentType method, and return any key (It could be typeof(Image)), otherwise the grid will “think” the cells contain text, and the Images will be recycled together with the labels, causing unexpected behavior.
The recycling needs overriding the three methods GetCellContentType, CreateCellContent and BindCellContent.
The first tells the grid what kind of content there is in the cell, the second creates the UI element, and the third binds the UI with the data item. When the key returned in GetCellContentType corresponds to a “bucket” containing recycled cells, the CreateCellContent is not called and the recycled cells is used. Next, the BindCellContent is executed (to update the image source in your case). The UnbindCellContent is not mandatory but it is useful to detach to events that were attached in the BindCellContent.
Hope it helps,
Alvaro.