Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Determining Which TGrid Column is Updating.
Tue, Jul 4 2017 7:07 AMPermanent Link

Steve Gill

Avatar

I want to load status images into 3 columns in a databound grid.  I'm using the CellUpdate event which seems to work fine, except I can't work out which column is being updated.

I have tried using ACell.Index but that seems to be the row not the column.

For example:

  if ACell.Index = 0 then
  begin
     if ACell.Data = 'True' then
     begin
        ACell.Background.Image.Name := 'images/image1.png';
        ACell.Background.Fill.Color := clTransparent;
        ACell.Background.Image.RepeatStyle := rsNone;
        ACell.Background.Image.PositionType := ptCenterCenter;
     end
     else
     begin
        ACell.Background.Image.Name := 'images/image2.png';
        ACell.Background.Fill.Color := clTransparent;
        ACell.Background.Image.RepeatStyle := rsNone;
        ACell.Background.Image.PositionType := ptCenterCenter;
     end;
  end;

What is the correct way to do this?

= Steve
Tue, Jul 4 2017 8:52 AMPermanent Link

Steve Gill

Avatar

Ok, something weird was going on.  When I double-clicked on each column's OnCellUpdate event they all linked to the same event.  But after restarting EWB they all linked to their own.

So I think it's all good now.

= Steve
Tue, Jul 4 2017 8:52 AMPermanent Link

Steve Gill

Avatar

Ok, something weird was going on.  When I double-clicked on each column's OnCellUpdate event they all linked to the same event.  But after restarting EWB they all linked to their own.

So I think it's all good now.

= Steve
Image