Filter DataGrid Bound To Heirarchical TDBGrid

Posted by: jnash on 4 July 2019, 9:40 am EST

    • Post Options:
    • Link

    Posted 4 July 2019, 9:40 am EST

    I’m unable to successfully apply a filter to a heirarchical TDBGrid.

    We’ve used DataTables bound to a TDBGrid which has the filter bar visible. On the Filter Change event the DataTable’s DefaultView RowFilter is changed and the rows displayed by the TDBGrid change accordingly.

    This works very well until the TDBGrid is changed to be Heirarchical. Then changes to the master grid’s filters still trigger the Filter Change event but as before but changes to the DataTable’s DefaultView RowFilter no longer cause the master grid’s rows to change. Nevertheless the number of rows in the table’s DefaultView do change as expected.

    It seems that the TDBGrid in heirarchical view is not bound or does not use the table’s default view as in the other case.

    Thanks in advance for any help.

  • Posted 5 July 2019, 9:17 am EST

    Hello,

    I too can replicate the behavior when DataSet is assigned to the DataSource property of the TrueDbGrid and the parent DataTable is assigned to the DataMember property. I am investigating this.

    For a time being you can assign the parent DataTable to the DataSource property, it will work fine.

    Please find the attached sample which demonstrate the above solution.

    Thanks and Regards,

    Prabhat Sharma.

    QueryTrueDBGrid.zip

  • Posted 5 July 2019, 9:27 am EST

    Thank you. This seems to only be a problem if I try to do a custom filter (for example if i want to filter the column for values that contain “JO” [JO] vs. values that just begin with “JO”).

    If I instead use the grid’s Allow Filter property and don’t utilize the Filter Change event at all then everything works as expected.

    Thank you for looking into this issue and for now I can use the simple filter or your suggestion.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels