Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Hidden First Column in Grid
Mon, Jul 22 2013 6:50 AMPermanent Link

Chris Holland

SEC Solutions Ltd.

Avatar

Team Elevate Team Elevate

Hi,

I have come across a strange problem where I get an error if the first
column in my grid is marked as visible := false;

The error tells me that it "cannot get offsetTop for a null value".

I have managed to overcome the problem by testing for null in the source
code MakeCellVisible procedure, but was wondering if this is a bug or if
this value should never be null and I am doing something wrong to have
this value returned as null?

procedure TGridColumn.MakeCellVisible(RowIndex: Integer);
var
   TempCell: THTMLElement;
   TempScrollTop: Integer;
   TempGridOffset: Integer;
   TempCellOffset: Integer;
begin
   MakeColumnVisible;
   TempCell:=GetCellElement(RowIndex);
   if TempCell <> nil then // <------------   ADDED THIS TEST HERE
      begin
         TempScrollTop:=FGrid.Table.scrollTop;
         TempGridOffset:=(TempScrollTop+FGrid.Table.clientHeight);
         TempCellOffset:=(TempCell.offsetTop+TempCell.offsetHeight);
         if (TempCellOffset > TempGridOffset) then

FGrid.Table.scrollTop:=(TempScrollTop+(TempCellOffset-TempGridOffset))
         else if (TempCell.offsetTop < FGrid.Table.scrollTop) then

FGrid.Table.scrollTop:=(FGrid.Table.scrollTop-(FGrid.Table.scrollTop-TempCell.offsetTop));
      end;
end;


--
Chris Holland
[Team Elevate]
Tue, Jul 23 2013 3:10 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Chris,

<< I have come across a strange problem where I get an error if the first
column in my grid is marked as visible := false; >>

It's probably just a bug.  Is the column that you're making invisible the
active column ?  That's probably the reason, and I'll have a fix for this in
the next build.

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Image