Subject | Re: [IBO] only one grid cell blank after refresh |
---|---|
Author | Michael Fung |
Post date | 2003-10-14T01:58:02Z |
I tried repaint and refresh but it doesn't help.
=====================================
procedure TfmProdSrch.ProdSrch();
begin
with qrProdSrch do begin
InvalidateSQL;
if Active then
Refresh
else
Open;
if not IsEmpty then begin //found
grResult.Visible := True; // grResult is a IB_Grid
plNotFound.Visible := False;
grResult.SetFocus;
grResult.Repaint;
grResult.Refresh;
SaveSelected; // auto select 1st record
end else begin //not found
grResult.Visible := False;
plNotFound.Visible := True;
edPN.SetFocus;
edPN.SelectAll;
end;
end;
end;
// OnPrepareSQL event for qrProdSrch
procedure TfmProdSrch.qrProdSrchPrepareSQL(Sender: TIB_Statement);
begin
inherited;
with qrProdSrch do begin
SQLWhere.Text := 'where P.PN like ' + QuotedStr('%' +
edPN.Text + '%');
if zcbBrand.SelectedKey <> '' then begin
SQLWhere.Append(' and P.Brand_ID = ' +
zcbBrand.SelectedKey);
end;
end;
end;
=====================================
procedure TfmProdSrch.ProdSrch();
begin
with qrProdSrch do begin
InvalidateSQL;
if Active then
Refresh
else
Open;
if not IsEmpty then begin //found
grResult.Visible := True; // grResult is a IB_Grid
plNotFound.Visible := False;
grResult.SetFocus;
grResult.Repaint;
grResult.Refresh;
SaveSelected; // auto select 1st record
end else begin //not found
grResult.Visible := False;
plNotFound.Visible := True;
edPN.SetFocus;
edPN.SelectAll;
end;
end;
end;
// OnPrepareSQL event for qrProdSrch
procedure TfmProdSrch.qrProdSrchPrepareSQL(Sender: TIB_Statement);
begin
inherited;
with qrProdSrch do begin
SQLWhere.Text := 'where P.PN like ' + QuotedStr('%' +
edPN.Text + '%');
if zcbBrand.SelectedKey <> '' then begin
SQLWhere.Append(' and P.Brand_ID = ' +
zcbBrand.SelectedKey);
end;
end;
end;
--- In IBObjects@yahoogroups.com, "Luiz" <cprmlao@i...> wrote:
>
> ----- Original Message -----
> From: "Michael Fung" <ibo@c...>
> To: <IBObjects@yahoogroups.com>
> > I have a TIB_Grid with an underlying read only ib_query. When the
> > query is refreshed with some param change, the new result shows
on
> > the grid but with one cell(not one row) *blank* with no data.
Only by
> > scrolling can make the cell data appear.
>
> I also have noted this behaviour as well.
>
> Luiz.