如TableView是为TcxDBTableView的话,那 TableView.DataController.Groups.ChildCount(1); //这里得到的是第一个组的总数 看看下面我以前写的一段代码 for i := 0 to Tableview.Controller.SelectedRowCount - 1 do begin //判断选择的是否为组的行 if TableView.Controller.SelectedRows[i] is TcxGridGroupRow then begin //取得组的行的index; GRowIndex := TableView.Controller.SelectedRows[i].Index; //取得组的行的ID; GRowID := TableView.DataController.Groups.DataGroupIndexByRowIndex[GRowIndex]; //这里得到的是组的行的那个标题 ShowMessage(TableView.DataController.Groups.GroupValues[GRowID]); //这里是组的行数 ShowMessage(IntToStr(TableView.DataController.Groups.ChildCount[GRowID])); end; end;end;
TableView.DataController.Groups.ChildCount(1); //这里得到的是第一个组的总数
看看下面我以前写的一段代码
for i := 0 to Tableview.Controller.SelectedRowCount - 1 do
begin
//判断选择的是否为组的行
if TableView.Controller.SelectedRows[i] is TcxGridGroupRow then
begin
//取得组的行的index;
GRowIndex := TableView.Controller.SelectedRows[i].Index;
//取得组的行的ID;
GRowID := TableView.DataController.Groups.DataGroupIndexByRowIndex[GRowIndex];
//这里得到的是组的行的那个标题
ShowMessage(TableView.DataController.Groups.GroupValues[GRowID]);
//这里是组的行数
ShowMessage(IntToStr(TableView.DataController.Groups.ChildCount[GRowID]));
end;
end;end;