You are not logged in.
Pages: 1
By default TSQLTableToGrid.Refresh auto resizes the column widths but I want to turn off this feature. Could a 'ResizeColumns' parameter be added to the function like below?
function TSQLTableToGrid.Refresh(ForceRefresh: Boolean=false; ResizeColumns: Boolean=true): boolean;
var Refreshed: boolean;
aID: integer;
begin
if self=nil then
result := false else begin
aID := Table.IDColumnHiddenValue(TDrawGrid(Owner).Row);
if ForceRefresh then
result := true else
result := Client.UpdateFromServer([Table],Refreshed) and Refreshed;
if result then
AfterRefresh(aID, ResizeColumns);
end;
end;
procedure TSQLTableToGrid.AfterRefresh(aID: integer, ResizeColumns: Boolean);
var CurrentRow: integer;
Bulk: boolean;
begin
with TDrawGrid(Owner) do begin
if Table.RowCount=0 then
RowCount := 2 else
RowCount := Table.RowCount+1;
if Table.FieldCount<>ColCount then begin
// we get results from a void table for the first time
ColCount := Table.FieldCount;
SetLength(fFieldOrder,Table.FieldCount);
end;
CurrentRow := Table.RowFromID(aID);
if CurrentRow=0 then
CurrentRow := 1;
Row := CurrentRow;
TopRow := 1;
Invalidate;
end;
if ResizeColumns then
Resize(nil); // auto resize columns
if Assigned(OnSelectCell) then
OnSelectCell(Owner,0,CurrentRow,Bulk); // refresh details
end;
Offline
Could you please add a feature request ticket?
See http://synopse.info/fossil/reportlist (after anonymous login to the fossil repository)
with a link to this forum thread (for feedback and ideas)
Offline
Just added a ticket. Sorry initially missed your response.
Thanks
Offline
Pages: 1