avoid drawing data if dataset is empty

git-svn-id: trunk@9702 -
This commit is contained in:
jesus 2006-08-05 19:41:46 +00:00
parent 2fcdb04917
commit b4de789eaa

View File

@ -283,6 +283,7 @@ type
FTempText : string; FTempText : string;
FDrawingActiveRecord: Boolean; FDrawingActiveRecord: Boolean;
FDrawingMultiSelRecord: Boolean; FDrawingMultiSelRecord: Boolean;
FDrawingEmptyDataset: Boolean;
FEditingColumn: Integer; FEditingColumn: Integer;
FOldPosition: Integer; FOldPosition: Integer;
FDefaultColWidths: boolean; FDefaultColWidths: boolean;
@ -1674,7 +1675,8 @@ begin
else else
if (aRow=0)and(ACol>=FixedCols) then if (aRow=0)and(ACol>=FixedCols) then
DrawCellText(aCol,aRow,aRect,aState,GetColumnTitle(aCol)); DrawCellText(aCol,aRow,aRect,aState,GetColumnTitle(aCol));
end else begin end else
if not FDrawingEmptyDataset then begin
F := GetFieldFromGridColumn(aCol); F := GetFieldFromGridColumn(aCol);
case ColumnEditorStyle(aCol, F) of case ColumnEditorStyle(aCol, F) of
cbsCheckBoxColumn: cbsCheckBoxColumn:
@ -2306,7 +2308,9 @@ var
begin begin
if FDataLink.Active then begin if FDataLink.Active then begin
CurActiveRecord:=FDataLink.ActiveRecord; CurActiveRecord:=FDataLink.ActiveRecord;
end; FDrawingEmptyDataset:=FDatalink.DataSet.IsEmpty;
end else
FDrawingEmptyDataset:=True;
try try
inherited DrawAllRows; inherited DrawAllRows;
finally finally