property Items.GroupItem (Item as HITEM) as Long
Indicates a group item if positive, and the value specifies the index of the column that has been grouped.

TypeDescription
Item as HITEM A Long expression that specifies the handle of the item being queried
Long A Long expression that specifies index of the column being grouped, or a negative value if the item is a regular item, not a grouping item. 
The GroupItem method determines the index of the column that indicates the column being grouped. In other words, the CellCaption(Item,GroupItem(Item) ) gets the default caption to be displayed for the grouping item. The Ungroup method removes all grouping items. For instance, when a column gets grouped by, the control sorts by that column, collects the unique values being found, and add a new item for each value found, by adding the items of the same value as children. The (AddGroupItem event is fired for each new item to be inserted in the Items collection during the grouping.

The following samples show how to display the grouping items with a solid background color, instead of a single line:

VBA
Private Sub G2antt1_AddGroupItem(ByVal Item As Long)
	With G2antt1
		With .Items
			.ItemDividerLine(Item) = 0
			.CellHAlignment(Item,.GroupItem(Item)) = 1
			.ItemBackColor(Item) = RGB(240,240,240)
		End With
	End With
End Sub
VB
Private Sub G2antt1_AddGroupItem(ByVal Item As EXG2ANTTLibCtl.HITEM)
	With G2antt1
		With .Items
			.ItemDividerLine(Item) = EmptyLine
			.CellHAlignment(Item,.GroupItem(Item)) = CenterAlignment
			.ItemBackColor(Item) = RGB(240,240,240)
		End With
	End With
End Sub
VB.NET
Private Sub Exg2antt1_AddGroupItem(ByVal sender As System.Object,ByVal Item As Integer) Handles Exg2antt1.AddGroupItem
	With Exg2antt1
		With .Items
			.set_ItemDividerLine(Item,exontrol.EXG2ANTTLib.DividerLineEnum.EmptyLine)
			.set_CellHAlignment(Item,.get_GroupItem(Item),exontrol.EXG2ANTTLib.AlignmentEnum.CenterAlignment)
			.set_ItemBackColor(Item,Color.FromArgb(240,240,240))
		End With
	End With
End Sub
C++
void OnAddGroupItemG2antt1(long Item)
{
	EXG2ANTTLib::IG2anttPtr spG2antt1 = GetDlgItem(IDC_G2ANTT1)->GetControlUnknown();
	EXG2ANTTLib::IItemsPtr var_Items = spG2antt1->GetItems();
		var_Items->PutItemDividerLine(Item,EXG2ANTTLib::EmptyLine);
		var_Items->PutCellHAlignment(Item,var_Items->GetGroupItem(Item),EXG2ANTTLib::CenterAlignment);
		var_Items->PutItemBackColor(Item,RGB(240,240,240));
}
C++ Builder
void __fastcall TForm1::G2antt1AddGroupItem(TObject *Sender,Exg2anttlib_tlb::HITEM Item)
{
	Exg2anttlib_tlb::IItemsPtr var_Items = G2antt1->Items;
		var_Items->set_ItemDividerLine(Item,Exg2anttlib_tlb::DividerLineEnum::EmptyLine);
		var_Items->set_CellHAlignment(TVariant(Item),TVariant(var_Items->get_GroupItem(Item)),Exg2anttlib_tlb::AlignmentEnum::CenterAlignment);
		var_Items->set_ItemBackColor(Item,RGB(240,240,240));
}
C#
private void exg2antt1_AddGroupItem(object sender,int Item)
{
	exontrol.EXG2ANTTLib.Items var_Items = exg2antt1.Items;
		var_Items.set_ItemDividerLine(Item,exontrol.EXG2ANTTLib.DividerLineEnum.EmptyLine);
		var_Items.set_CellHAlignment(Item,var_Items.get_GroupItem(Item),exontrol.EXG2ANTTLib.AlignmentEnum.CenterAlignment);
		var_Items.set_ItemBackColor(Item,Color.FromArgb(240,240,240));
}
JavaScript
<SCRIPT FOR="G2antt1" EVENT="AddGroupItem(Item)" LANGUAGE="JScript">
	var var_Items = G2antt1.Items;
		var_Items.ItemDividerLine(Item) = 0;
		var_Items.CellHAlignment(Item,var_Items.GroupItem(Item)) = 1;
		var_Items.ItemBackColor(Item) = 15790320;
</SCRIPT>
X++ (Dynamics Ax 2009)
void onEvent_AddGroupItem(int _Item)
{
	COM com_Items;
	anytype var_Items;
	;
	var_Items = exg2antt1.Items(); com_Items = var_Items;
		com_Items.ItemDividerLine(_Item,0/*EmptyLine*/);
		com_Items.CellHAlignment(_Item,com_Items.GroupItem(_Item),1/*CenterAlignment*/);
		com_Items.ItemBackColor(_Item,WinApi::RGB2int(240,240,240));
}
VFP
*** AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection. ***
LPARAMETERS Item
	with thisform.G2antt1
		with .Items
			.ItemDividerLine(Item) = 0
			.CellHAlignment(Item,.GroupItem(Item)) = 1
			.ItemBackColor(Item) = RGB(240,240,240)
		endwith
	endwith

with thisform.G2antt1
	.BeginUpdate
	.HasLines = 0
	.ColumnAutoResize = .F.
	rs = CreateObject("ADOR.Recordset")
	with rs
		var_s = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\SAMPLE.MDB"
		.Open("Orders",var_s,3,3)
	endwith
	.DataSource = rs
	.SingleSort = .F.
	.SortBarVisible = .T.
	.AllowGroupBy = .T.
	.Columns.Item(1).SortOrder = .T. && .T.
	.EndUpdate
endwith
Delphi (standard)
procedure TForm1.G2antt1AddGroupItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			ItemDividerLine[Item] := EXG2ANTTLib_TLB.EmptyLine;
			CellHAlignment[OleVariant(Item),OleVariant(GroupItem[Item])] := EXG2ANTTLib_TLB.CenterAlignment;
			ItemBackColor[Item] := $f0f0f0;
		end;
	end
end;
Visual Objects
METHOD OCX_Exontrol1AddGroupItem(Item) CLASS MainDialog
	// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection.
	local var_Items as IItems
	var_Items := oDCOCX_Exontrol1:Items
		var_Items:[ItemDividerLine,Item] := EmptyLine
		var_Items:[CellHAlignment,Item,var_Items:[GroupItem,Item]] := CenterAlignment
		var_Items:[ItemBackColor,Item] := RGB(240,240,240)
RETURN NIL