I'm using TAdvStringGrid and my column 0 contains image from TImageList component. When saving that grid into CSV file image index is saved as column 0 value.
The problem is when using LoadFromCSV as column 0 is filled with the actual image index (number). So, I'm trying to remove the number (image index) and replace it with the actual image:
for(int i = 1; i < SG1->RowCount; i++){
int pindex = SG1->Cells[0].ToInt();
SG1->Cells[0] = ""; // removing the number (image index)
SG1->AddImageIdx(0, i, pindex, haCenter, vaCenter);
}
If I use this code here I will be able to remove the number (image index) and place actual image. But, when using SaveToCSV again I get "" (empty quotes) instead of the image index for column 0. As I saw it it's because of this line:
SG1->Cells[0] = ""; // removing the number (image index)
So, to resolve this? I need to remove the number and show the image, but save the image index next time I use SaveToCSV.
Thanks.
Got it...
Need to use AddDataImage instead of AddImageIdx.