I want to group columns and have a heading for each group. I thought I would be able to do this with band headers but I can't see any way to do it. Any ideas?
Group 1 | Group 2
-------------------------------------------------------
G1C1 | G1C2 | G1C3 | G2C1 | G2C2 | G2C3
-------------------------------------------------------
Merge cells in Band
Re: Merge cells in Band
Hello,
Taking the Header_Footer example, this seems to work fine for me here:
Taking the Header_Footer example, this seems to work fine for me here:
Code: Select all
type
THouse=record
public
Address : String;
Floors : Integer;
end;
TPerson=record
public
Name : String;
Phone : Integer;
end;
TPropriety=record
public
House: THouse;
Owner: TPerson;
end;
var
Proprieties : TArray<TPropriety>;
procedure TFormHeaderFooter.FormCreate(Sender: TObject);
begin
SetLength(Proprieties,2);
Proprieties[0].House.Address:='123 St';
Proprieties[0].House.Floors:=5;
Proprieties[0].Owner.Name:='John';
Proprieties[0].Owner.Phone:=666777888;
Proprieties[1].House.Address:='456 St';
Proprieties[1].House.Floors:=2;
Proprieties[1].Owner.Name:='Marc';
Proprieties[1].Owner.Phone:=666777666;
TeeGrid1.Data:=TVirtualData<TArray<TPropriety>>.Create(Proprieties);
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Merge cells in Band
That does work (except for the column lines in the header). But, it is done completely automatically. My data does not fit that model so I want to know how to do that using code?
In the process of trying to figure out how to change the header text, I deleted the only entry in the "Headers" collection of the TeeGrid component. This caused unrecoverable errors in the IDE. Should I file a bug report?
In the process of trying to figure out how to change the header text, I deleted the only entry in the "Headers" collection of the TeeGrid component. This caused unrecoverable errors in the IDE. Should I file a bug report?
Re: Merge cells in Band
Hello,
http://bugs.teechart.net/show_bug.cgi?id=2026
We are investigating the options available to do this. We'll be back to you asap here.Koot33 wrote:That does work (except for the column lines in the header). But, it is done completely automatically. My data does not fit that model so I want to know how to do that using code?
I've just added it to the public tracker. Thanks for reporting it.Koot33 wrote:In the process of trying to figure out how to change the header text, I deleted the only entry in the "Headers" collection of the TeeGrid component. This caused unrecoverable errors in the IDE. Should I file a bug report?
http://bugs.teechart.net/show_bug.cgi?id=2026
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Merge cells in Band
Hello,
You could set the format brush to paint above that line. In the same example:Koot33 wrote:except for the column lines in the header
Code: Select all
TeeGrid1.Columns[0].Header.ParentFormat:=False;
TeeGrid1.Columns[0].Header.Format.Brush.Visible:=True;
TeeGrid1.Columns[0].Header.Format.Brush.Color:=clGray;
TeeGrid1.Columns[1].Header.ParentFormat:=False;
TeeGrid1.Columns[1].Header.Format.Brush.Visible:=True;
TeeGrid1.Columns[1].Header.Format.Brush.Color:=clGray;
Still investigating the options we have for doing this manually.Koot33 wrote:But, it is done completely automatically. My data does not fit that model so I want to know how to do that using code?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Merge cells in Band
Hello,
I've made an example of doing the same with a database here.
As TeeGrid is designed, you only can have subcolumns using a TVirtualData array with an structure of records and subrecords as in the Header_Footer example I mentioned in my first reply in this thread.Yeray wrote:Still investigating the options we have for doing this manually.Koot33 wrote:But, it is done completely automatically. My data does not fit that model so I want to know how to do that using code?
I've made an example of doing the same with a database here.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |