Jump to content
uniGUI Discussion Forums
TI.ME

Filter uniDbGrid runTime

Recommended Posts

Good Morning!!!

I'm creating a Filter option in uniDbGrid in runtime ...

All component connections ...

The visual display is perfect, but the filter code does not work.

When I type the letter no, the event is triggered but the value of the second letter on, the event is not even triggered !!!

I have a project ready but I do not know how to attach in the forum !!!

Could you guide me ???

Unigui Version 1.10.0 Build 1469

 

 

 

Code Customer...

 

 

procedure TMainForm.UniFormCreate(Sender: TObject);
var
  oHidePanel : TUniHiddenPanel;
  oEdit : array of TUniEdit;
  i : integer;
begin
  TUniHiddenPanel(oHidePanel) := TUniHiddenPanel.Create(Self);
 
  for I := 0 to Pred(UniDBGrid1.Columns.Count) do
  begin
    SetLength(oEdit,Length(oEdit)+1);
    TUniEdit(oEdit)        := TUniEdit.Create(Self);
    TUniEdit(oEdit).Parent := TUniHiddenPanel(oHidePanel).Parent;
    TUniEdit(oEdit).Width  := UniDBGrid1.Columns.Items.Width - 10;
    TUniEdit(oEdit).Name   := 'Edit_'+IntToStr(i);
    UniDBGrid1.Columns.Items.Filtering.Enabled := True;
    UniDBGrid1.Columns.Items.Filtering.Editor  := TUniEdit(oEdit);
  end;
 
  UniMainModule.ADOQuery1.Open;
  UniMainModule.ADOQuery2.Open;
end;

Share this post


Link to post
Share on other sites

 

Good Morning!!!

 

I'm creating a Filter option in uniDbGrid in runtime ...

 

All component connections ...

 

The visual display is perfect, but the filter code does not work.

 

When I type the letter no, the event is triggered but the value of the second letter on, the event is not even triggered !!!

 

I have a project ready but I do not know how to attach in the forum !!!

 

Could you guide me ???

 

Unigui Version 1.10.0 Build 1469

 

 

 

Code Customer...

 

 

procedure TMainForm.UniFormCreate(Sender: TObject);
var
  oHidePanel : TUniHiddenPanel;
  oEdit : array of TUniEdit;
  i : integer;
begin
  TUniHiddenPanel(oHidePanel) := TUniHiddenPanel.Create(Self);
 
  for I := 0 to Pred(UniDBGrid1.Columns.Count) do
  begin
    SetLength(oEdit,Length(oEdit)+1);
    TUniEdit(oEdit)        := TUniEdit.Create(Self);
    TUniEdit(oEdit).Parent := TUniHiddenPanel(oHidePanel).Parent;
    TUniEdit(oEdit).Width  := UniDBGrid1.Columns.Items.Width - 10;
    TUniEdit(oEdit).Name   := 'Edit_'+IntToStr(i);
    UniDBGrid1.Columns.Items.Filtering.Enabled := True;
    UniDBGrid1.Columns.Items.Filtering.Editor  := TUniEdit(oEdit);
  end;
 
  UniMainModule.ADOQuery1.Open;
  UniMainModule.ADOQuery2.Open;
end;

 

 

tente assim:

 

procedure TMainForm.UniFormCreate(Sender: TObject);
var
  oHidePanel : TUniHiddenPanel;
  oEdit : array of TUniEdit;
  i : integer;
begin
  oHidePanel := TUniHiddenPanel.Create(Self);
  oHidePanel.Parent := self;
  self.InsertControl(oHidePanel);
 
  for I := 0 to Pred(UniDBGrid1.Columns.Count) do
  begin
    SetLength(oEdit,Length(oEdit)+1);
    TUniEdit(oEdit)        := TUniEdit.Create(Self);
    TUniEdit(oEdit).Parent := oHidePanel;
    TUniEdit(oEdit).Width  := UniDBGrid1.Columns.Items.Width - 10;
    TUniEdit(oEdit).Name   := 'Edit_'+IntToStr(i);
 
    UniDBGrid1.Columns.Items.Filtering.Enabled := True;
    UniDBGrid1.Columns.Items.Filtering.Editor  := TUniEdit(oEdit);
    UniDBGrid1.Columns.Filtering.ChangeDelay := 250;
  end;
 
  UniMainModule.ADOQuery1.Open;
  UniMainModule.ADOQuery2.Open;
end;

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

×