procedure TForm1.InitGrid;
begin
advstringgrid1.Grouping.MergeHeader := true; //这个什么作用没有是
advstringgrid1.Grouping.HeaderColor := clWhite; //渐变颜色
advstringgrid1.Grouping.HeaderColorTo := clInfoBk;
advstringgrid1.SaveFixedCells := false;
advstringgrid1.LoadFromCSV('.\cargroups.csv'); advstringgrid1.Group(); //第一列分组
advstringgrid1.SubGroup(); //又按子里面的 第一列分组
advstringgrid1.ContractAll; //全部收起来 树
advstringgrid1.Cells[, ] := 'Brand';
advstringgrid1.Cells[, ] := 'Type';
advstringgrid1.Cells[, ] := 'Cyl';
end;
BMW,,,
BMW,,320D,
BMW,,320CI,
BMW,,330CI,
BMW,,M3,
BMW,,,
BMW,,520D,
BMW,,530D,
BMW,,540I,
BMW,,M5,
BMW,,,
BMW,,M6,
BMW,,730D,
BMW,,730I,
BMW,,740D,
BMW,,,
Mercedes,SLK,,
Mercedes,SLK,,
Mercedes,SLK,55AMG,
Mercedes,SL,,
Mercedes,SL,,
Mercedes,SL,55AMG,
Mercedes,SL,,
Mercedes,SL,65AMG,
Mercedes,S,320CDI,
Mercedes,S,400CDI,
Mercedes,S,,
Mercedes,S,55AMG,
Mercedes,S,,
Mercedes,S,65AMG,
Mercedes,C,,
Mercedes,C,220CDI,
Mercedes,C,270CDI,
Mercedes,C,,
Mercedes,C,55AMG,
Mercedes,E,220CDI,
Mercedes,E,270CDI,
Mercedes,E,,
Mercedes,E,55AMG,
Mercedes,CL,,
Mercedes,CL,55AMG,
Mercedes,CL,,
Mercedes,CL,65AMG,
05-08 15:44