Home Forums WinForms controls Xceed Grid for WinForms GroupBy Row Counts Issue with Extensibility Filtering Method

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17036 |

    Hey there,

    I am using Extensibility Sample and created my own Filtering mecahnism, which is using exact same mechanism of FilterRows & Group By Functions.

    Earlier when I was doing Filterings I was creating DataTable with Select Statements to produce correct Resultset for my use and was binding it to grid.

    In that case whenever I did grouping the Row summary Count was correct because datasource was exact to my filters.

    Since I have started using Extensibility Sample and instead of creating new Filtered DataSet I am using Visible state True / False Group by Summary count is not what it represent.

     

    For Example.

     I have 5  Rows of Field A = “ABC”.

    If I select Field A with ABC value and GroupBy Field A then the group Summary Rows Shows me Row Count of 5, which is Correct

    Then I go and Add Second Filter which is Field B = “XYZ” where the Row Count is 3.

    Result:

    List Rows are filtered to 3 but the Groupby Summary Rows Count is still showing 5.

    Is there anyway I can get the Count  of GroupRows which is to the Filtered Rows?

     

    You can easily replicate this one by running the Extensibility sample.

    Pick  Employee = “ANDREW”

    Then GroupBy Employee (Result, list Shows 8 Rows and GroupBy Summary shows “Employee: Andrew – 8 item(s)”)

    Then select ShipCountry Filter to Germany, (Result, list Shows 3 Rows and GroupBy Summary shows “Employee: Andrew – 8 item(s)”)

     My Requirement is to Show Following:

     List  should show 3 Rows

    and

    GroupBy Summary shows “Employee: Andrew – 3 item(s)”

    What is the best way to achieve that, this is causing issues to our functionality and there is not a single simpler way for me to achieve it..

    NR

     

     

    Imported from legacy forums. Posted by NR (had 1710 views)

    User (Old forums)
    Member
    Post count: 23064

    The best is to filter the source, but if you can’t do this for whatever reason, we have a very ugly workaround.

    First, you need to add an unbound column with its Visible property set to false.  Second, subscribe to the AddingDataRow event, and in the event handler, set the value of the cell corresponding to this column to a reference to a static object (so no unnecessary memory is used).  Third, set the TitleFormat property on the GroupManagerRow to the stat function %COUNT:%, using the unbound invisible column as the target of the function.

    Finally, when hiding a row, you will need to set the cell value of the hidden column to null.  When showing a row, you will need to set it back to the static object.

    This will display the right row count, because the COUNT function does not add cells with null values.

    Note that the grid does not offer a filter feature.  We provide this as a sample, with no guarantee it works in all scenarios.  It is a basic implementation, that needs to be incremented on to become robust.

    Imported from legacy forums. Posted by André (had 1512 views)

    User (Old forums)
    Member
    Post count: 23064

    Ugly work around is not so much Ugly.

    I have tried and with a few other things it is ok. Working fine.

    Imported from legacy forums. Posted by NR (had 1963 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.