Jump to content

Gabriel

uniGUI Subscriber
  • Posts

    66
  • Joined

  • Last visited

Posts posted by Gabriel

  1. Hi, 

     

    I've change the GridsFilter demo.

    You can add a button, and put the next code on the OnClick event:

     



    procedure TUniGridsFilter.UniButton2Click(Sender: TObject);
    begin
    UniDBGrid1ClearFilters(self);
    UniEdit1.Text := '';
    end;


     

    of course, this will only work with the first filter.

     

    After you run the project, filter the first column, let's say with the letter "Z". 

     

    The filter works.

     

    Click on the new button, and the filter will disappear. 

     

    If you put "Z" again on the first filter it will not work.

     

     

    By the way, another related question. ¿It is posible to call the dgFilterClearButton event with Javascript?

     

    Regards

  2. Hi. I was able to clean the filter from a TButton by simple iterate over them and set the text to ''. But a strange things happen.

     

    Lets say I filter the first column with the value 1. Works like a charm. Now, I use the UniButton to clear all the filter and refresh the grid. Also Works like a charm. The issue begin when I want to set the filter to the first column again, if I put a value different from the original value I entered (1 in this case) it works, but if I use 1 again, it doesn't work until I type another value.

     

    Is like the filter keep remembering the original value and the event doesn't get executed.

  3. Hi,

     

     

    Can you check it once again ?!

    Because it should work

     

    Best regards,

     

     

    I will.

     

    ¿I have to specify anything special in the conection? ¿Could you see the code that I upload?

     

    FDQuery does not have the method ADOQuery1.Requery;, as used on the example. I have to use either TAdsConnection or FDConnection

     

    Please. Help!

     

    Regards

  4. I've tried everythig, and still can't refresh the data grid.

     

    the only thing that works was closing the connection, and then open it again, like this:

    procedure TMainForm.UniDBGrid1ColumnFilter(Sender: TUniDBGrid;
      const Column: TUniDBGridColumn; const Value: Variant);
    begin
    if UniMainModule.AdsQuery.Active then
      begin
        UniMainModule.ADsQuery.Params.ParamByName(Column.FieldName).Value := '%'+Value+'%';
        UniMainModule.AdsConnection1.Disconnect;
        UniMainModule.AdsQuery.Open;
      end
    end;
    

    So, basically, the problem is with the connection.

     

    Also tried with FdConnection and FDQuery, same issue.

     

    ¿Does anyone have a working example with FDConnection? using Filters?

     

     

    Regards

  5. If I use

    UniMainModule.AdsQuery.SQL.Clear;
    UniMainModule.AdsQuery.SQL.Add('Select * from elPersonas where Empleado <=500');
    UniMainModule.AdsQuery.Open;
    

    The query is executed and the DbGrid updated, almost instantly. So the issue must be with the params definition.

  6. UniMainModule.AdsQuery.Refresh;

     

    And remember UniDBGrid1.Columns[x].Editor = an uniedit field placed in a uniHiddenPanel.

     

    As i said, I also try Closing, and Opening the Query, Refreshing it. But nothing seems to work.

  7. Hi, 

     

    I'm using an AdsQuery to populate a data from and Advantage Database, wich works great. But I'm Having problem filtering the data (I'm trying to make the same thing as the GridFilter example, but with an AdsQuery).

     

    I Just can't refresh the query.

     

    This is my code on the UniDbGridColumnFilter event

    procedure TMainForm.UniDBGrid1ColumnFilter(Sender: TUniDBGrid;
      const Column: TUniDBGridColumn; const Value: Variant);
    begin
    if UniMainModule.AdsQuery.Active then
      begin
        UniMainModule.ADsQuery.Params.ParamByName(Column.FieldName).Value := '%'+Value+'%';
    
        UniMainModule.AdsQuery.Open;
      end
    end;
    

    I also try Closing, and Opening the Query, Refreshing it. But nothing seems to work.

     

     

    Regards

     

    Gabriel

     

×
×
  • Create New...