EhLib.Com
https://forum.ehlib.com/en/

Repeat Image in Column
https://forum.ehlib.com/en/viewtopic.php?f=5&t=850
Page 1 of 2

Author:  jsm [ 15 Sep 2018, 14:05 ]
Post subject:  Repeat Image in Column

Hi,
I want repeat a image(similar images list or from other source) in column with specific number , please guide me.

Author:  jsm [ 15 Sep 2018, 16:37 ]
Post subject:  Re: Repeat Image in Column

Another question is about column title
how can i change align between text and image in title(for example show image right/left text or also set space between title caption and image)

Author:  EhLibSupport [ 20 Sep 2018, 06:51 ]
Post subject:  Re: Repeat Image in Column

Hello

Assign Column.ImageList = MyImageList
and write
Column.OnGetCellParams event with setting Params.ImageIndex parameter


Code:
procedure TForm1.DBGridEh1Columns0GetCellParams(Sender: TObject;
  EditMode: Boolean; Params: TColCellParamsEh);
begin
  if (MemTableEh1.FieldByName('Continent').AsString = 'North America') then
    Params.ImageIndex := 1;
end;



You can also assign Column.ShowImageAndText = True to show image and field value in the cell.

Attachments:
sshot-4.png
sshot-4.png [ 13.33 KiB | Viewed 4651 times ]

Author:  EhLibSupport [ 20 Sep 2018, 07:18 ]
Post subject:  Re: Repeat Image in Column

Hello

Quote:
Another question is about column title
how can i change align between text and image in title(for example show image right/left text or also set space between title caption and image)


Unfortunately you can not control these parameters.
The only way is to use OnDrawTitleCell event.

Author:  jsm [ 27 Sep 2018, 08:18 ]
Post subject:  Re: Repeat Image in Column

No, I mean about repeat:
For Example 'Score' Column

Attachments:
Grid.png
Grid.png [ 4.02 KiB | Viewed 4634 times ]

Author:  jsm [ 12 Nov 2018, 06:12 ]
Post subject:  Re: Repeat Image in Column

Hi,
Is there a way to do this?

Author:  EhLibSupport [ 12 Nov 2018, 08:18 ]
Post subject:  Re: Repeat Image in Column

Hello

You can draw images from imagelist in the TColumnEh.OnAdvDrawDataCell event handler

Code:
procedure TForm1.DBGridEh1Columns1AdvDrawDataCell(Sender: TCustomDBGridEh; Cell,
  AreaCell: TGridCoord; Column: TColumnEh; const ARect: TRect;
  var Params: TColCellParamsEh; var Processed: Boolean);
var
  steps: Integer;
  i: Integer;
begin
  Sender.DefaultDrawColumnDataCell(Cell, AreaCell, Column, ARect, Params);
  Processed := True;
  steps := MemTableEh1.FieldByName('Population').AsInteger div 1000000;
  if steps > 10 then steps := 10;
  for I := 0 to steps do
  begin
    ilPaymentType.Draw(Sender.Canvas, 2 + i * 18 + ARect.Left, ARect.Top + 2, 1);
  end;
end;


Attachments:
sshot-44.png
sshot-44.png [ 32.37 KiB | Viewed 4444 times ]

Author:  jsm [ 01 Dec 2020, 06:11 ]
Post subject:  Re: Repeat Image in Column

jsm wrote:
Another question is about column title
how can i change align between text and image in title(for example show image right/left text or also set space between title caption and image)

Seems interesting, is it possible to add it?

Author:  EhLibSupport [ 02 Dec 2020, 19:38 ]
Post subject:  Re: Repeat Image in Column

Hello

Is there a way for you to use spaces in the text to simulate indentation?

Attachments:
sshot-164.png
sshot-164.png [ 30.83 KiB | Viewed 3588 times ]

Author:  jsm [ 03 Dec 2020, 16:18 ]
Post subject:  Re: Repeat Image in Column

Hi,
For space yes, but for Alignment?

Page 1 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/