Jump to content
uniGUI Discussion Forums
eduardosuruagy

How to view or make dbgrid filters invisible in real time?

Recommended Posts

How to view or make dbgrid filters invisible in real time? I did a routine for this but when the dbgrid scroll is all to the right side of the video the filters are misaligned.

procedure TFrameMasterListener.BtnFilterClick (Sender: TObject);
var I: Integer;
begin
  if BtnFiltro.Tag = 0 then
  begin
    dbgrid_cadastro2.Columns.BeginUpdate;
    for I: = 0 to dbgrid_cadastro2.Columns.Count - 1 of
      if not dbgrid_cadastro2.Columns .Filtering.Enabled then
      begin
        if dbgrid_cadastro2.Columns .Tag = 0 then
        begin
          dbgrid_cadastro2.Columns .Filtering.Editor: = TUniEdit (Self.FindComponent ('edit _' + dbgrid_cadastro2.Columns.Items .FieldName));
          dbgrid_cadastro2.Columns .Filtering.Enabled: = True;
        end;
      end;

    dbgrid_cadastro2.Columns.EndUpdate;
    BtnFiltro.Tag: = 1;
  end
  else if BtnFiltro.Tag = 1 then
  begin
    dbgrid_cadastro2.Columns.BeginUpdate;
    for I: = 0 to dbgrid_cadastro2.Columns.Count - 1 of
      if dbgrid_cadastro2.Columns .Filtering.Enabled then
      begin
        dbgrid_cadastro2.Columns .Filtering.Editor: = nil;
        dbgrid_cadastro2.Columns .Filtering.Enabled: = False;
      end;

    dbgrid_cadastro2.Columns.EndUpdate;

    if CDCadastro.Active then
    begin
      CDCadastro.Filter: = '';
      CDCadastro.Filtered: = False;
    end;

    BtnFilter.Tag: = 0;
  end;
end;

Share this post


Link to post
Share on other sites

Hello,

Which build are you using ?!

Have you seen this post ?:

 

Share this post


Link to post
Share on other sites

I add this information : if I create columns and filter fields before showing the form (instead of pushing a button to create them), I do not see the filter fields.

Share this post


Link to post
Share on other sites
20 hours ago, Sherzod said:

Olá,

Qual build você está usando ?!

Você viu este post?

 

I'm using the latest version

 

I saw this post and it was because of him that I did my example

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×