Grid with imagelist

Hi,

I have a TTIWAdvWebGrid with a TPNGIMageList attached to the Images property. I have one column set to type ctDataImage and I am setting the text value of that column to the index number of the image in the list I want to display. This all works well.

Say that I have 4 rows in the grid. I delete one of the rows (say row 2, the third row). I update the image list so that the image associated with the old row 2 is removed and the image that was previously in position 3 is moved into position 2. Although the grid now has 3 rows, the images it displays are from rows 0, 1, and the old row 2, whereas it should be displaying 0, 1 and the old row 3. The grid continues to display the wrong image for row 2 until the app is restarted.

Is there a way to make the grid refresh the displayed images from the image list? Is this perhaps a caching problem?


Did you verify in the HTML output whether this row 2 is pointing to a different image file than before deleting row 2?

I have checked the HTML. I had 5 rows in my grid. I inspected the HTML for each of the image cells and this is what i found:

APPLE:
<img border="0" align="MIDDLE" width="16" height="16" name="GRDPROMOITEMFRMEATPROMOITEM" src="/$/Cache/user/1m9aegd1lumci810kxcbx0zzsd5a/BMPC490.tmp">
BANANA:
<img border="0" align="MIDDLE" width="16" height="16" name="GRDPROMOITEMFRMEATPROMOITEM" src="/$/Cache/user/1m9aegd1lumci810kxcbx0zzsd5a/BMPC491.tmp">
KIWIFRUIT:
<img border="0" align="MIDDLE" width="16" height="16" name="GRDPROMOITEMFRMEATPROMOITEM" src="/$/Cache/user/1m9aegd1lumci810kxcbx0zzsd5a/BMPC492.tmp">
ORANGE:
<img border="0" align="MIDDLE" width="16" height="16" name="GRDPROMOITEMFRMEATPROMOITEM" src="/$/Cache/user/1m9aegd1lumci810kxcbx0zzsd5a/BMPC493.tmp">
PEAR:
<img border="0" align="MIDDLE" width="16" height="16" name="GRDPROMOITEMFRMEATPROMOITEM" src="/$/Cache/user/1m9aegd1lumci810kxcbx0zzsd5a/BMPC494.tmp">


I then deleted Kiwifruit (row 2), cleared the PNGImageList and reloaded it with images for Apple, Banana, Orange and Pear. I rechecked the HTML for each image cell and this is what I got:

After deleting Kiwifruit
APPLE:
<img border="0" align="MIDDLE" width="16" height="16" name="GRDPROMOITEMFRMEATPROMOITEM" src="/$/Cache/user/1m9aegd1lumci810kxcbx0zzsd5a/BMPC490.tmp">
BANANA:
<img border="0" align="MIDDLE" width="16" height="16" name="GRDPROMOITEMFRMEATPROMOITEM" src="/$/Cache/user/1m9aegd1lumci810kxcbx0zzsd5a/BMPC491.tmp">
ORANGE:
<img border="0" align="MIDDLE" width="16" height="16" name="GRDPROMOITEMFRMEATPROMOITEM" src="/$/Cache/user/1m9aegd1lumci810kxcbx0zzsd5a/BMPC492.tmp">
PEAR:
<img border="0" align="MIDDLE" width="16" height="16" name="GRDPROMOITEMFRMEATPROMOITEM" src="/$/Cache/user/1m9aegd1lumci810kxcbx0zzsd5a/BMPC493.tmp">

Apple and Pear are correct. The Orange row shows the kiwifruit image and the Pear row shows the orange image because these are the images that are still in the cache. The grid continues to display the incorrect images until the application is restarted. Is there something I am doing wrong or some setting I need to change?

Thank you.

Have you tried using a direct link to an image file instead of using the cached image file from an ImageList?