cxGrid grouping expand the plus

cxGrid grouping expand the plus
original edge of human Last post on 2014-05-08 10:34:23 read the number 3125 collection
launched
1. First put a cxGrid, set the View, Set View.DataController connection DataSource
2. activate DataSource connection the DataSet, double-click cxGrid, click Retrieve Fields, acquired all of Column
3. set View of OptionsView.Footer = True, OptionsView.GroupFooters = True, this is in order to show up grouped subtotals and totals panel
4. "order number" drag panel packet field cxGrid above (GroupbyBox), the data are "Order number" packet. Then you will find all the data is single shrink up, if you want to make all data deployment, you can set View.DataController.Options.dcoGroupsAlwaysExpanded = True

  Do not drag can also find the field, set GroupIndex property to 0 on it, multi-level grouping

You can also write code

cxGrid1DBTableView1DBColumn3.GroupIndex := 0 ;

or

cxGrid1DBTableView1.Columns [. 3] .GroupIndex: = 0;
5. The packet is provided Subtotal: View.DataController.Summary.DefaultGroupSummaryItems point to open a new Item, Column Larry select the next attribute "number" field, FieldName property is null , format property value of the display format can be set, Kind properties drop-down skSum sum, Position property must choose spFooter.
6. Set Total: View.DataController.Summary.FooterSummaryItems point to open a new Item, Column Larry select the next attribute "number" field, FieldName property is empty, Format property value of the display format can be set, the Kind property drop-down skSum plus total, Position property must choose spFooter.
We're done, press F9 to look at the fruits of victory it.

Complimentary then a skill, Form1 came alive again in a TcxGridPopupMenu control, in the next cxGrid controls, the TcxGridPopupMenu the Grid property to your cxGrid.
Then run the program, in the operating state, click everywhere, left or right on the Grid, you will have a windfall.

 

//    cxGrid1DBTableView1DBColumn3.GroupIndex := 0 ;
cxGrid1DBTableView1.Columns[3].GroupIndex :=0;
cxGrid1DBTableView1.OptionsView.GroupByBox:=false;
cxGrid1DBTableView1.DataController.Groups.FullExpand;
cxGrid1DBTableView1.OptionsView.GroupRowStyle := grsOffice11;
 

procedure TForm13.ToolButton1Click(Sender: TObject);
begin
cxGrid1DBTableView1.DataController.Groups.FullExpand;
end;

TForm13.ToolButton2Click Procedure (Sender: TObject);
the begin
cxGrid1DBTableView1.DataController.Groups.FullCollapse;
----------------
Disclaimer: This article is CSDN blogger "human edge" of the original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/cb168/article/details/25284875

Guess you like

Origin www.cnblogs.com/westsoft/p/12216349.html