Handling Event when Row Filtering is done

42 views
Skip to first unread message

alesho...@gmail.com

unread,
Mar 10, 2021, 4:27:43 AM3/10/21
to Migrated By Firefly
Hi,

I am looking for event that fires every time filtering is done.

I have s method to sum all rows (witn ReadAllRows method), I run it in beginning. When user filters rows (with Ctrl + R and AllowFilterRows = true) I want to call this method again to sum rows, that are shown. 

I need to call this methos every time new data is shown on view.

It works on OnEnterRow, so the sum method works, I only need to call it in right event.

Thank you.

Noam Honig

unread,
Mar 10, 2021, 10:56:13 AM3/10/21
to alesho...@gmail.com, Migrated By Firefly
I would do that in the EnterRow and compare the previous Where to the current one, and if it changed execute the logic.

Better yet, move it to the base AbstractUIContorller and you can work with it throughout your code.


Snippet
string _lastWhere;
protected override void OnEnterRow()
{
    var where = ENV.Utilities.FilterHelper.ToSQLWhere(this, Where);
    if (where != _lastWhere)
    {
        _lastWhere = where;
        _rowCount = 0;
        ReadAllRows(() => _rowCount++);
    }
}
Number _rowCount = 0;
public Number GetRowCount() => _rowCount;


Noam Honig  
Founder & CEO


--
You received this message because you are subscribed to the Google Groups "Migrated By Firefly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to migrated-by-fir...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/migrated-by-firefly/a8e2200c-bbf0-4b45-8651-7576a4638fb1n%40googlegroups.com.
Message has been deleted

Noam Honig

unread,
Mar 24, 2026, 9:55:10 AM (11 days ago) Mar 24
to Matt Mac, Migrated By Firefly
I would follow the code in AbstractUIController that revolves around Where.
for example the AddUserMethodRange etc... see if that's part of your game.



Noam Honig  
Founder & CEO


On Tue, Mar 24, 2026 at 3:15 PM Matt Mac <csharpi...@gmail.com> wrote:
Could I please ask with regards to this line:

var where = ENV.Utilities.FilterHelper.ToSQLWhere(this, Where);

Is there any scenario in which you can think of that influences the result of that with regards to filters that are added to the actual Grids on the forms? I have one projects whereby this result of where includes the filters that are added on the Grid controls but in another project the result of where does NOT included filters added to the Grid on the form but I'm struggling to determine why.

Reply all
Reply to author
Forward
0 new messages