Hi, how put an image that it is not in a dataset into an image column?
Hi,
Thank you. sorry for posted twice
item
CheckTrue = 'true'
CheckFalse = 'false'
ColumnHeaderFont.Color = clNone
ColumnHeaderFont.Size = 10
ColumnHeaderFont.Style = []
ColumnType = ctImage
DefaultDynEdit = '0'
DefaultDynText = '0'
DetailFont.Color = clNone
DetailFont.Size = 10
DetailFont.Style = []
ImageIndex = 0
Font.Color = clNone
Font.Size = 10
Font.Style = []
FooterFormat = '%g'
Name = 'EDIT'
SpinEditMaxValue = 100
SpinEditMinValue = 0
Width = 32
end
var ImagesPath: string;
begin
ImagesPath := 'Immagini';
if ColumnIndex = 0 then
if dsDocuments.DataSet.FieldByName('DATA_LETTURA').IsNull and dsDocuments.DataSet.FieldByName('DATA_STAMPA').IsNull
then
AValue := TPath.Combine(ImagesPath,'flag_mark_red.png')
else
AValue := TPath.Combine(ImagesPath,'flag_mark_green.png');
end;
- Can you please make sure the path to the image is correct?By default an IntraWeb application expects the files to be inside a subfolder of the application called "wwwroot".- You can assign a TIWImageList to the Images property, the set the Columns.ImageIndex property to the desired image index.
Yes, I have already checked the path that seems to be correct
We are not aware of any issues with displaying an image in a Column of ColumnType ctImage.
Can you please check in the browser's page source if the correct path has been added in the cell as expected?
Thank you for notifying this was resolved.
now
another problem occurs, when I click on a grid row after the
grdElencoAsyncRowSelect detected seems that the GetCellData event is not
executed and so the column loose the images
You can send the sample project by email to: mailto:help@tmssoftware.com
Hi, if I reload the page with F5 key, then the images are shown correctly
Hi,
Can you please try changing your code as indicated below?<o:p></o:p>
procedure TFStampeSLP.grdElencoGetCellData(Sender: TObject; RowIndex, ColumnIndex: Integer; var AValue: string);
var
ImagesPath: string;
begin
ImagesPath := 'Immagini';
if ColumnIndex = 0 then
if dsDocuments.DataSet.FieldByName('DATA_LETTURA').IsNull and dsDocuments.DataSet.FieldByName('DATA_STAMPA').IsNull
then
AValue := ImagesPath + '/flag_mark_red.png'
else
AValue := ImagesPath + '/flag_mark_green.png';
end;