Async refresh of a ctDataImage Column


I have a problem displaying a ctDataImage column using Async paging.

I use a TTIWDBAdvWebGrid to display records from a Client Dataset that shows different images from an imagelist. The image is selected on the value of a field. The ColumnType in the grid is ctDataImage and everything works fine unless I set the grid property AsyncPaging to true.

In this case the first page is fine, but when I browse between other pages of the dataset the ctDataImage column is not refreshed. The text data (from the same or other fields) is updated without any problem, but the image displayed in the ctDataImage column is the one of the previous page. It is no more linked to the Imagelist.

What can I do to display the correct image? Do I need to revert to sync paging?

Thanks in advance for your help.

Unfortunately it's not supported to use images from an IWImageList in combination with async paging.

As an alternative you can put the required image files in your application's image file folder.
If your database field contains only an index value for the ImageList, you can replace the index value with the image name using the OnGetCellData event.

if ColumnIndex = 4 then
  if AValue = '0' then
    AValue := '/files/image0.png'
  else AValue = '1' then
    AValue := '/files/image1.png'

Bart Holvoet2012-05-02 04:05:17