Row suppressed (hidden), Grouping and wrong GroupCount value

Hi

I did find a problem though :wink:

With tAdvColumnGrid and make a grouping set the property Grouping.ShowGroupCount to True.

The count always remains the same even if lines are deleted (SuppressRow) or hidden (HideRow) according the "FilterType" property you use (ftHide/ftSuppress).

Regards

You do a refresh (like grid.Invalidate) after you hide rows?

Hi,

Do you understand what's happened ?

I admit to being a little confused with 'grouping' and 'suppressed'.

I have included another project with 2 'difficulties'. The first one with 'grouping' and sorting... and the second one still with the number of rows in a group not varying while rows are suppressed.

I Also try to use the procedure MergeColumnCells to dispaly the same visual, but also a problem occurs when row are suppressed

Node.zip (10.7 KB)

Kind regards
olivier

I really cannot understand what you see wrong.
After loading I see:

After grouping on column 1, this results in:

and I cannot see what wrong with this. As far as I can see, this is a correct grouped grid on column 1.

What is the meaning of
"the line associated to the grouping is uncorrect."

What line? What association? What is incorrect?

I send you my answer by direct mail last friday, did you receive it ? or you prefer I use this forum ?

regards
olivier

I could not see an email here on Friday.
Did you make sure this email does NOT contain any potentially harming files like .EXE files as these emails are automatically blocked for security reasons.

I send you back this mail by direct mail. Dis you receive it this time.

Anyway, This is the contents :

Hi

I don't understand either ??? I found the same result as you and it is correct ???

When I create the project few days ago (with the same version af all componants), the line "metal ring info, 7, 104, 1, 354" (i.e. last line of this group) was placed after grouping into the group "conditions de reprise". and look like this :

Maybe I made a mistake, but it's still weird to make such a big mistake! :( (i need hollydays)

sorry

kind regards

I see in your screenshot a different result. I got the email with this screenshot.
However, I cannot reproduce this.
Are you sure you have a clean install of only the latest version v10.8.5.0 of TMS VCL UI Pack and you effectively linked with this latest version?

As I Indicated, the pb about "Gouping insorted" doesn't occur for me too. I don't undestrand ...

However, problems remained for "Grouping" and "Merging", the 2 goupbox on the right of the grid

Kind regards

Grouping with FilterType = ftSuppress and independently from grouping also using suppressrow(s) are mutually exclusive features. Both internally use the suppress mechanism, so using it simultaneously in two different ways conflicts.
You could set FilterType = ftHide and then separately use SuppressRow(s). But the group row count is based on the result of the grouping and is not taking the suppress afterwards in account.

Ok , it works (but trivial D) )

Ok for the group count. However, according to me, it should indicate the nb of visible/diplayable row and not the nb of available row.

I tryed the function GetNodeSpan(Row), and as the 'group count', reflected then number of available rows and not diplayable rows.
There is a way to get the number of this diplayable rows by node ?

regards

At this moment there is not a built-in function that returns just the not-suppressed number of rows per group, it is always the total nr. of rows in the group.

Ok

And about Merging, I do something wrong ?

And may I propose these Functions ? :

 FUNCTION GetChildAvailable(
     Sender : TAdvColumnGrid;
     Row : Integer)
   : Integer;
 VAR
     I : Integer;
 BEGIN
     (Sender AS TAdvColumnGrid).BeginUpdate;
     result := -1;
     TRY
         IF (Sender AS TAdvColumnGrid).IsNode(Row) THEN
         BEGIN
             result := 0;
             FOR I := Row + 1 TO Row + (Sender AS TAdvColumnGrid).GetNodeSpan(Row) - 1 DO
             BEGIN
                IF (NOT(Sender AS TAdvColumnGrid).IsSuppressedRow(I)) AND (NOT(Sender AS TAdvColumnGrid).IsHiddenRow(I)) THEN
                       Inc(result);
             END; // Fin de IF
         END;
 
     FINALLY
         (Sender AS TAdvColumnGrid).EndUpdate;
     END; // Fin de FINALLY
 END; // Fin de FUNCTION

returns the number of child from a node

and

 FUNCTION GetChildSupp_Hidden(
     Sender : TAdvColumnGrid;
     Row : Integer)
   : Integer;
 VAR
     I : Integer;
 BEGIN
     (Sender AS TAdvColumnGrid).BeginUpdate;
     result := -1;
     TRY
         IF (Sender AS TAdvColumnGrid).IsNode(Row) THEN
         BEGIN
             result := 0;
             FOR I := Row + 1 TO Row + (Sender AS TAdvColumnGrid).GetNodeSpan(Row) - 1 DO
             BEGIN
                 IF (Sender AS TAdvColumnGrid).IsSuppressedRow(I) OR (Sender AS 
 AdvColumnGrid).IsHiddenRow(I) THEN
                       Inc(result);
             END; // Fin de IF
         END;
 
     FINALLY
         (Sender AS TAdvColumnGrid).EndUpdate;
     END; // Fin de FINALLY
 END; // Fin de FUNCTION

returns the number of suppressed or hidden rows for a node

Do you have some news specially about "merging" pb ?

regards

Please isolate this problem and provide a full sample source project + step by step information with which we can reproduce the problem. It is really hard and mostly trial & error work to try from partial code snippets and not knowing full component property settings or event handlers, to reproduce a problem.

No pb, I will do as soon as return from my hollydays

sorry

Hi
I am back to work...

I send the project about merging functions in few minuts.

What do think about the function I proposed to add to a better management of Grouping?

Regards

Olivier