Type | Description | |||
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 following samples show how to display the grouping items with a solid background color, instead of a single line:
VBAPrivate Sub Grid1_AddGroupItem(ByVal Item As Long) With Grid1 With .Items .ItemDividerLine(Item) = 0 .CellHAlignment(Item,.GroupItem(Item)) = 1 .ItemBackColor(Item) = RGB(240,240,240) End With End With End SubVB
Private Sub Grid1_AddGroupItem(ByVal Item As EXGRIDLibCtl.HITEM) With Grid1 With .Items .ItemDividerLine(Item) = EmptyLine .CellHAlignment(Item,.GroupItem(Item)) = CenterAlignment .ItemBackColor(Item) = RGB(240,240,240) End With End With End SubVB.NET
Private Sub Exgrid1_AddGroupItem(ByVal sender As System.Object,ByVal Item As Integer) Handles Exgrid1.AddGroupItem With Exgrid1 With .Items .set_ItemDividerLine(Item,exontrol.EXGRIDLib.DividerLineEnum.EmptyLine) .set_CellHAlignment(Item,.get_GroupItem(Item),exontrol.EXGRIDLib.AlignmentEnum.CenterAlignment) .set_ItemBackColor(Item,Color.FromArgb(240,240,240)) End With End With End SubC++
void OnAddGroupItemGrid1(long Item) { EXGRIDLib::IGridPtr spGrid1 = GetDlgItem(IDC_GRID1)->GetControlUnknown(); EXGRIDLib::IItemsPtr var_Items = spGrid1->GetItems(); var_Items->PutItemDividerLine(Item,EXGRIDLib::EmptyLine); var_Items->PutCellHAlignment(Item,var_Items->GetGroupItem(Item),EXGRIDLib::CenterAlignment); var_Items->PutItemBackColor(Item,RGB(240,240,240)); }C++ Builder
void __fastcall TForm1::Grid1AddGroupItem(TObject *Sender,Exgridlib_tlb::HITEM Item) { Exgridlib_tlb::IItemsPtr var_Items = Grid1->Items; var_Items->set_ItemDividerLine(Item,Exgridlib_tlb::DividerLineEnum::EmptyLine); var_Items->set_CellHAlignment(TVariant(Item),TVariant(var_Items->get_GroupItem(Item)),Exgridlib_tlb::AlignmentEnum::CenterAlignment); var_Items->set_ItemBackColor(Item,RGB(240,240,240)); }C#
private void exgrid1_AddGroupItem(object sender,int Item) { exontrol.EXGRIDLib.Items var_Items = exgrid1.Items; var_Items.set_ItemDividerLine(Item,exontrol.EXGRIDLib.DividerLineEnum.EmptyLine); var_Items.set_CellHAlignment(Item,var_Items.get_GroupItem(Item),exontrol.EXGRIDLib.AlignmentEnum.CenterAlignment); var_Items.set_ItemBackColor(Item,Color.FromArgb(240,240,240)); }JavaScript
<SCRIPT FOR="Grid1" EVENT="AddGroupItem(Item)" LANGUAGE="JScript"> var var_Items = Grid1.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 = exgrid1.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.Grid1 with .Items .ItemDividerLine(Item) = 0 .CellHAlignment(Item,.GroupItem(Item)) = 1 .ItemBackColor(Item) = RGB(240,240,240) endwith endwith with thisform.Grid1 .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\ExGrid\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 endwithDelphi (standard)
procedure TForm1.Grid1AddGroupItem(ASender: TObject; Item : HITEM); begin with Grid1 do begin with Items do begin ItemDividerLine[Item] := EXGRIDLib_TLB.EmptyLine; CellHAlignment[OleVariant(Item),OleVariant(GroupItem[Item])] := EXGRIDLib_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