Grouping and hidden column(s)

Good morning to all,

i use grop procedure to show some data in other way (i.e. by opertor).

All works well, but if in the grid i have one or more hideen column(s) i got this



First chance exception at $7533C54F. Exception class EInvalidGridOperation with message 'Grid index out of range'. Process WinfarmUtility.exe (3564)



After little investigation the exception occours in

procedure TAdvStringGrid.UnGroup; at ColWidths[FGroupColumn] := FGroupWidth;



In my case, with hidden column(s), FGroupColumn is greater the colcount and the exception is fired up.



Can you confrim that??



Thank's for your attention



Regards

Daniele

I have retested this here but I cannot reproduce a problem.

Test code:


procedure TForm1.Button1Click(Sender: TObject);
begin
  advstringgrid1.Group(1);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  advstringgrid1.UnGroup;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  advstringgrid1.RowCount := 50;
  advstringgrid1.ColCount := 10;
  advstringgrid1.RandomFill(false, 10);
  advstringgrid1.HideColumn(3);
  advstringgrid1.HideColumn(4);
end;

Good morning Bruno,

i'll check again on my procedure ....

The job is a little complex.

It's possible who i do some errors in the code.

New situation, i work without problem with group and filter separately.

It is possible work with together?

My case 1:

1) Load the grid. It has 3 hidden columns (ok)

2) Organized the grid by group (operator name) (ok)

3) Filter the grid by product code (the filter is not applied)



My case 2:

1) Load the grid. It has 3 hidden columns (ok)

2) Filter the grid by product code (OK)

3) Organized the grid by group by operator name; the groups are showed in strange report



There is a rule to follow ??



Thank you for all



Regards

Daniele







Hi Bruno,

seems that group and filter don't work together.

At the moment before aplpy one of them, if one is setted before apply the second the first one is removed.

For example

- Grid loaded

- Apply filter

- Now gruoping, filter is active, before groping remove the filter.

   - Grouping ok



Regards



Daniele