|
1278
|
Arrange the header on multiple levels using CRD feature

' AddColumn event - Fired after a new column has been added.
Private Sub Grid1_AddColumn(ByVal Column As EXGRIDLibCtl.IColumn)
With Grid1
With Column
End With
End With
End Sub
With Grid1
sep = 6
.BeginUpdate
.BackColorLevelHeader = RGB(255,255,255)
.ColumnAutoResize = False
.HeaderAppearance = Etched
.SelBackMode = exTransparent
.DrawGridLines = exRowLines
.GridLineStyle = exGridLinesSolid
.GridLineColor = RGB(224,224,224)
With .Columns
With .Add("Ball")
.Visible = True
.Width = 96
.Editor.EditType = EditType
End With
.Add("Grit").Visible = True
With .Add("Ball Shape")
.Visible = True
.FormatLevel = "2/3,4,5,6,7,8,9,10,11,12,13"
.Def(exCellFormatLevel) = "3,4,5,6,7,8,9,10,11,12,13"
.Width = 176
End With
.Add("S").Key = "Ball Shape.1"
.Add("").Key = "Ball Shape.2"
.Add("").Key = "Ball Shape.3"
.Add("").Key = "Ball Shape.4"
.Add("").Key = "Ball Shape.5"
.Add("").Key = "Ball Shape.6"
.Add("").Key = "Ball Shape.7"
.Add("").Key = "Ball Shape.8"
.Add("").Key = "Ball Shape.9"
.Add("").Key = "Ball Shape.10"
.Add("A").Key = "Ball Shape.11"
With .Add("")
.AllowSizing = False
.Visible = True
.Def(exHeaderBackColor) = 33554431
.Width = sep
.Position = Grid1.Columns.Item("Grit").Position
End With
With .Add("")
.AllowSizing = False
.Visible = True
.Def(exHeaderBackColor) = 33554431
.Width = sep
.Position = Grid1.Columns.Item("Ball Shape").Position
End With
End With
With .Items
h = .AddItem("Clear Storm Teal")
.CellValue(h,"Grit") = 3500
.CellBackColor(h,"Ball Shape.1") = RGB(160,160,160)
h = .AddItem("Equinox Solid")
.CellValue(h,"Grit") = 2500
.CellBackColor(h,"Ball Shape.7") = RGB(160,160,160)
.CellBackColor(h,"Ball Shape.8") = RGB(160,160,160)
End With
.EndUpdate
End With
|
|
1277
|
Temporarily disable events
' AddItem event - Occurs after a new Item has been inserted to Items collection.
Private Sub Grid1_AddItem(ByVal Item As EXGRIDLibCtl.HITEM)
With Grid1
Debug.Print( "AddItem event" )
End With
End Sub
With Grid1
.FreezeEvents True
.BeginUpdate
.Columns.Add "Name"
With .Items
.AddItem "no AddItem event occurs"
End With
.EndUpdate
.FreezeEvents False
End With
|
|
1276
|
Difference between %0 (value) and %C0 (caption) when aggregate functions are applied to formatted columns
' AddColumn event - Fired after a new column has been added.
Private Sub Grid1_AddColumn(ByVal Column As EXGRIDLibCtl.IColumn)
' Column.Editor.EditType = 4
End Sub
' Change event - Occurs when the user changes the cell's content.
Private Sub Grid1_Change(ByVal Item As EXGRIDLibCtl.HITEM, ByVal ColIndex As Long, NewValue As Variant)
With Grid1
.Refresh
End With
End Sub
With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
With .Columns
.Add "Numbers"
.Add("Double").FormatColumn = "2 * dbl(%0)"
.Add("Index").FormatColumn = "1 index ``"
.Add("Index").FormatColumn = "1 index ``"
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.ItemBackColor(h) = RGB(240,240,240)
.CellValue(h,0) = "sum(all,dir,dbl(%0))"
.CellValueFormat(h,0) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.FormatCell(h,0) = "'Sum(%0): <b>'+value"
.CellValue(h,1) = "sum(all,dir,dbl(%C1))"
.CellValueFormat(h,1) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.FormatCell(h,1) = "'Sum(%C1): <b>'+value"
.CellValue(h,2) = "sum(all,dir,dbl(%2))"
.CellValueFormat(h,2) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.FormatCell(h,2) = "'Sum(%2): <b>'+value"
.CellValue(h,3) = "sum(all,dir,dbl(%C3))"
.CellValueFormat(h,3) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.FormatCell(h,3) = "'Sum(%C3): <b>'+value"
End With
With .Items
.AddItem 10
.AddItem 25
.AddItem 31
.AddItem 48
End With
.EndUpdate
End With
|
|
1275
|
Add a footer that displays totals or summary values

' Change event - Occurs when the user changes the cell's content.
Private Sub Grid1_Change(ByVal Item As EXGRIDLibCtl.HITEM, ByVal ColIndex As Long, NewValue As Variant)
With Grid1
.Refresh
End With
End Sub
With Grid1
.HeaderAppearance = Etched
.HeaderHeight = 24
.ColumnAutoResize = False
.ContinueColumnScroll = False
.DrawGridLines = exVLines
.GridLineStyle = exGridLinesGeometric
Set rs = CreateObject("ADOR.Recordset")
With rs
.Open "Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3,3
End With
.DataSource = rs
.Columns.Item("EmployeeID").Width = 48
.Columns.Item("OrderDate").Width = 86
.Columns.Item("RequiredDate").Width = 86
.Columns.Item("ShippedDate").Width = 86
.Columns.Item("Freight").Width = 86
With .Items
.LockedItemCount(exBottom) = 2
h = .LockedItem(exBottom,0)
.ItemBackColor(h) = RGB(240,240,240)
.CellValueFormat(h,0) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.CellValue(h,0) = "count(all,dir,%0)"
.FormatCell(h,0) = "`Count: <b>` + value"
.CellValueFormat(h,1) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.CellValue(h,1) = "avg(all,dir,%1)"
.FormatCell(h,1) = "`Avg: <b>` + int(value)"
.CellValueFormat(h,2) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.CellValue(h,2) = "min(all,dir,%2)"
.FormatCell(h,2) = "`Min: <b>` + value"
.CellValueFormat(h,3) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.CellValue(h,3) = "min(all,dir,%3)"
.FormatCell(h,3) = "`Min: <b>` + value"
.CellValueFormat(h,4) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.CellValue(h,4) = "min(all,dir,%4)"
.FormatCell(h,4) = "`Min: <b>` + value"
.CellValueFormat(h,5) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.CellValue(h,5) = "avg(all,dir,%5)"
.FormatCell(h,5) = "`Avg: <b>` + int(value)"
.CellValueFormat(h,6) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.CellValue(h,6) = "sum(all,dir,%6)"
.FormatCell(h,6) = "`Total: <b>` + (value format `2`)"
h = .LockedItem(exBottom,1)
.ItemBackColor(h) = RGB(240,240,240)
.CellValueFormat(h,2) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.CellValue(h,2) = "max(all,dir,%2)"
.FormatCell(h,2) = "`Max: <b>` + value"
.CellValueFormat(h,3) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.CellValue(h,3) = "max(all,dir,%3)"
.FormatCell(h,3) = "`Max: <b>` + value"
.CellValueFormat(h,4) = ValueFormatEnum.exTotalField Or ValueFormatEnum.exHTML
.CellValue(h,4) = "max(all,dir,%4)"
.FormatCell(h,4) = "`Max: <b>` + value"
End With
End With
|
|
1274
|
Can I have a cell with dropdown AND checkbox
With Grid1
.BeginUpdate
.HeaderHeight = 24
.HeaderAppearance = Etched
.DefaultItemHeight = 22
.TreeColumnIndex = -1
.DrawGridLines = exRowLines
.GridLineStyle = exGridLinesSolid
.SelBackMode = exTransparent
With .Columns
With .Add("1st")
.Def(exCellButtonAutoWidth) = True
.Def(exCellHasButton) = True
.Width = 32
.AllowSizing = False
.Alignment = CenterAlignment
End With
With .Add("2nd").Editor
.EditType = CheckListType
.AddItem 1,"Border"
.AddItem 2,"Show Value"
.AddItem 4,"Editable"
End With
End With
With .Items
.CellValue(.AddItem(" B1 "),1) = 1
.CellValue(.AddItem(" B2 "),1) = 7
End With
.EndUpdate
End With
|
|
1273
|
Can I have a cell as a button
With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.DefaultItemHeight = 22
With .Columns
With .Add("Button")
.Def(exCellButtonAutoWidth) = True
End With
End With
With .Items
.CellHasButton(.AddItem(" B1 "),0) = True
.AddItem "no button"
.CellHasButton(.AddItem(" B2 "),0) = True
End With
.EndUpdate
End With
|
|
1272
|
How can I prevent the control from filtering while the user is typing in the filter prompt, and apply the filter only when the Enter key is pressed
With Grid1
.BeginUpdate
.ColumnAutoResize = True
.ContinueColumnScroll = 0
.MarkSearchColumn = False
.SearchColumnIndex = 1
.HeaderAppearance = Etched
.HeaderHeight = 24
.FilterBarPromptVisible = FilterBarVisibleEnum.exFilterBarPromptOnEnter Or FilterBarVisibleEnum.exFilterBarPromptVisible
.FilterBarPrompt = "<i><fgcolor=808080>Type filter and press Enter…</fgcolor></i>"
.FilterBarBackColor = Grid1.BackColor
.FilterBarPromptType = exFilterPromptStartWith
.Columns.Add "Name"
With .Items
.AddItem "Nancy Davolio"
.AddItem "Andrew Fuller"
.AddItem "Janet Leverling"
.AddItem "Margaret Peacock"
.AddItem "Steven Buchanan"
.AddItem "Michael Suyama"
.AddItem "Robert King"
.AddItem "Laura Callahan"
.AddItem "Anne Dodsworth"
End With
.EndUpdate
End With
|
|
1271
|
How can I set the first visible item (method 2)
With Grid1
.BeginUpdate
.HasLines = exNoLine
.ColumnAutoResize = False
Set rs = CreateObject("ADOR.Recordset")
With rs
.Open "Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3,3
End With
.DataSource = rs
With .Columns.Add("Pos")
.FormatColumn = "0 pos ``"
.Position = 0
.Width = 32
End With
.CountLockedColumns = 1
.Scroll exScrollVTo,.Items.ItemCount
.EndUpdate
With .Items
.EnsureVisibleItem .ItemByIndex(10)
End With
End With
|
|
1270
|
How can I set the first visible item (method 1)
With Grid1
.BeginUpdate
.HasLines = exNoLine
.ColumnAutoResize = False
Set rs = CreateObject("ADOR.Recordset")
With rs
.Open "Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb",3,3
End With
.DataSource = rs
With .Columns.Add("Pos")
.FormatColumn = "0 pos ``"
.Position = 0
.Width = 32
End With
.CountLockedColumns = 1
.ScrollBars = ScrollBarsEnum.exVScrollEmptySpace Or ScrollBarsEnum.exBoth
.ScrollPos(True) = 10
.EndUpdate
End With
|
|
1269
|
Hoist an item, promoting it and all its visible children to the top level
With Grid1
.BeginUpdate
.LinesAtRoot = exLinesAtRoot
With .Columns.Add("P1")
.Def(exCellHasCheckBox) = True
.PartialCheck = True
End With
With .Columns.Add("P2")
.Def(exCellHasCheckBox) = True
.PartialCheck = True
End With
With .Items
h1 = .AddItem("Root 1")
.InsertItem h1,,"Child 1"
.InsertItem h1,,"Child 2"
.ExpandItem(h1) = True
h2 = .AddItem("Root 2")
.InsertItem h2,,"Child 1"
.InsertItem h2,,"Child 2"
.HoistItem = h1
End With
.EndUpdate
End With
|
|
1268
|
Generates a PDF document on a single A0 page with no margins
With Grid1
.BeginUpdate
.LoadXML "C:\Program Files\Exontrol\ExGrid\Sample\XML\data.xml"
.ColumnAutoResize = False
.EndUpdate
var_CopyTo = .CopyTo("c:/temp/sample.pdf|33.11 in x 46.81 in|0 0 0 0|single")
End With
|
|
1267
|
Generates a PDF document that scales the content proportionally by 75% using B3 pages (default margins)
With Grid1
.BeginUpdate
.LoadXML "C:\Program Files\Exontrol\ExGrid\Sample\XML\data.xml"
.ColumnAutoResize = False
.EndUpdate
var_CopyTo = .CopyTo("c:/temp/sample.pdf|6.93 in x 9.84 in||75%")
End With
|
|
1266
|
Generates a PDF document that fits the content exactly to 3 A4 pages wide by 2 pages tall (default margins)
With Grid1
.BeginUpdate
.LoadXML "C:\Program Files\Exontrol\ExGrid\Sample\XML\data.xml"
.ColumnAutoResize = False
.EndUpdate
var_CopyTo = .CopyTo("c:/temp/sample.pdf|||3 x 2f")
End With
|
|
1265
|
Generates a PDF document that fits the content to 3 A3-landscape pages wide by 2 pages tall (custom margins)
With Grid1
.BeginUpdate
.LoadXML "C:\Program Files\Exontrol\ExGrid\Sample\XML\data.xml"
.ColumnAutoResize = False
.EndUpdate
var_CopyTo = .CopyTo("c:/temp/sample.pdf|16.54 in x 11.69 in|5 mm 5 mm 5 mm 5 mm|3 x 2")
End With
|
|
1264
|
Generates a PDF document that fits the content to 2 Letter pages tall, automatically determining the number of pages wide (default margins)
With Grid1
.BeginUpdate
.LoadXML "C:\Program Files\Exontrol\ExGrid\Sample\XML\data.xml"
.ColumnAutoResize = False
.EndUpdate
var_CopyTo = .CopyTo("c:/temp/sample.pdf|8.50 in x 11.00 in||x 2")
End With
|
|
1263
|
Generates a PDF document that fits the content to 1 page wide and as many A4 pages tall as required (default margins)
With Grid1
.BeginUpdate
.LoadXML "C:\Program Files\Exontrol\ExGrid\Sample\XML\data.xml"
.ColumnAutoResize = False
.EndUpdate
var_CopyTo = .CopyTo("c:/temp/sample.pdf|||1 x")
End With
|
|
1262
|
Generates a PDF document on a single A4 page (default margins)
With Grid1
.BeginUpdate
.LoadXML "C:\Program Files\Exontrol\ExGrid\Sample\XML\data.xml"
.ColumnAutoResize = False
.EndUpdate
var_CopyTo = .CopyTo("c:/temp/sample.pdf|||single")
End With
|
|
1261
|
Mask for Floating-Point Numbers (Emglish Style: . as Decimal, , as Grouping Separator)

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.DrawGridLines = exRowLines
.GridLineStyle = exGridLinesSolid
.SelForeColor = .ForeColor
.SelBackColor = .BackColor
.ShowFocusRect = False
With .Columns.Add("Float(English-style)")
.SortType = SortNumeric
.FormatColumn = "value format `3`"
.HeaderAlignment = RightAlignment
.Alignment = RightAlignment
With .Editor
.EditType = MaskType
.Mask = "!999,999,990.000;;;float,right,negative,grouping=\,,decimal=."
End With
End With
With .Items
.AddItem 192278.12
.AddItem 2829.7
.AddItem 7391.55
.AddItem 50812.23
.AddItem 913.04
.AddItem 127500.88
.AddItem 62.19
.AddItem 1
End With
.EndUpdate
End With
|
|
1260
|
Mask for Floating-Point Numbers (German Style: , as Decimal, . as Grouping Separator)

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.DrawGridLines = exRowLines
.GridLineStyle = exGridLinesSolid
.SelForeColor = .ForeColor
.SelBackColor = .BackColor
.ShowFocusRect = False
With .Columns.Add("Float(German-style)")
.SortType = SortNumeric
.FormatColumn = "value format `3`"
.HeaderAlignment = RightAlignment
.Alignment = RightAlignment
With .Editor
.EditType = MaskType
.Mask = "!999.999.990,000;;;float,right,grouping=.,decimal=\,"
End With
End With
With .Items
.AddItem 192278.12
.AddItem 2829.7
.AddItem 7391.55
.AddItem 50812.23
.AddItem 913.04
.AddItem 127500.88
.AddItem 62.19
.AddItem 1
End With
.EndUpdate
End With
|
|
1259
|
Locks the first visible column on the left and the last visible column on the right

With Grid1
.BeginUpdate
.ColumnAutoResize = False
.BackColorLock = RGB(192,192,192)
.GridLineStyle = exGridLinesSolid
.DrawGridLines = exVLines
.HeaderAppearance = Etched
Set rs = CreateObject("ADOR.Recordset")
With rs
.Open "Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.mdb",3,3
End With
.DataSource = rs
.CountLockedColumns = 17
.EndUpdate
End With
|
|
1258
|
Lock the column on the right

With Grid1
.BeginUpdate
.ColumnAutoResize = False
.BackColorLock = RGB(192,192,192)
.GridLineStyle = exGridLinesSolid
.DrawGridLines = exVLines
.HeaderAppearance = Etched
Set rs = CreateObject("ADOR.Recordset")
With rs
.Open "Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.mdb",3,3
End With
.DataSource = rs
.CountLockedColumns = 16
.EndUpdate
End With
|
|
1257
|
Lock the column on the left

With Grid1
.BeginUpdate
.ColumnAutoResize = False
.BackColorLock = RGB(192,192,192)
.GridLineStyle = exGridLinesSolid
.DrawGridLines = exVLines
.HeaderAppearance = Etched
Set rs = CreateObject("ADOR.Recordset")
With rs
.Open "Orders","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.mdb",3,3
End With
.DataSource = rs
.CountLockedColumns = 1
.EndUpdate
End With
|
|
1256
|
Update the item's lock state - pinning it to the top, bottom, or making it scrollable

With Grid1
.BeginUpdate
.Columns.Add "Column"
With .Items
.AddItem "un-locked item"
.LockItem(.AddItem("top-locked item")) = exLockTop
.LockItem(.AddItem("bottom-locked item")) = exLockBottom
End With
.EndUpdate
End With
|
|
1255
|
The Change event is called before changing the value. Is there any event such as Changed that is called after updating the cell's value
' Changed event - Occurs after the user has changed the content of a cell.
Private Sub Grid1_Changed(ByVal Item As EXGRIDLibCtl.HITEM, ByVal ColIndex As Long)
With Grid1
Debug.Print( .Items.CellValue(Item,ColIndex) )
End With
End Sub
With Grid1
.BeginUpdate
.Columns.Add("Edit").Editor.EditType = EditType
.Items.AddItem "Item 1"
.Items.AddItem "Item 2"
.EndUpdate
End With
|
|
1254
|
How can I reposition the +/- (expand/collapse) icon to show as "number, icon, text" (sample 2)
' AnchorClick event - Occurs when an anchor element is clicked.
Private Sub Grid1_AnchorClick(ByVal AnchorID As String, ByVal Options As String)
With Grid1
i = .FormatABC("int(value)",AnchorID)
With .Items
i = .ItemByIndex(i)
exp = .ExpandItem(i)
.ExpandItem(i) = Grid1.FormatABC("not value",exp)
End With
End With
End Sub
With Grid1
.BeginUpdate
.HTMLPicture("expand") = "gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYc7YYBY5vVBkiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyxgjsRzEKv1TqtXrNbrtfsIAwgASAH" & _
"AGShQwGQzGABUGEzudAqgyWdSmWw2Fw+sABSHI4AGH1XAGAxGAwywlI6eRqjGi1YuaJJEIJUHBPYqSJYKQAwCBDKbBPbncBibrUKQjGLFQo+TBFfR5GaUAR/KbGICyRx" & _
"siCOQClgdJxGoMpkGycpdDqUZ0EoJQJHYVoWCSCA4kEbRlHKRwJiYcYCH0PBNB2JwYCaCRsGcE8LDyfZKg+U59EsAZMlQCgJkcEA9CsywkiKJwiFcIQwEEgI="
.HTMLPicture("collapse") = "gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYU7YQBCooJSAiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzyO13dGEAGYzWcqlWrFarlesA3AGc" & _
"SAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWISpVLiXT5MrxiJyJJEIJUHBPYqSXYOQAgBgAB6jJwufxxX7YYhdYhFCSsSwSC4uMLoQajNJ" & _
"AG8QgZAgSIqGMCwRBkAJDicGwuiMeoHGeaRFlAU5qDwQQ6A+CYnlgPQeisGJfl4AJYhsRISjQYwJHIcpmmALAtlMEpkE4YBREmEpPBAARdicSw8AES5fi+fI5g+PpcAA" & _
"UJKgyCYknaZRrssJIiicIhXCEMBBICA=="
.HTMLPicture("empty") = "gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYE7YABNTWRIJiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyy/O13dGEAGYzWcqlWrFarlesA3AGc" & _
"SAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWYSvDpndpkQ9xhRTJJEIJUHBPdqSGIKYAwBgDUpCfytH57FqoVaTKQTGS0DJ6cDBDzOGwIfA" & _
"NHMIxJDmf5CFIAxwA4Q5HEQVJlEWRxnBkMANjsPoqBSEAElkfZ5CMFJMHCC52BALBGjkDpHCuXIAB2bQdEGaQgFIbbLCSIonCIVwhDAQSAg=="
.HeaderVisible = False
.HasLines = exNoLine
.HasButtons = exNoButtons
.Indent = 12
.DefaultItemHeight = 24
.DrawGridLines = exHLines
.GridLineStyle = exGridLinesSolid
.GridLineColor = RGB(204,204,204)
.ShowFocusRect = False
.ExpandOnDblClick = False
.ExpandOnKeys = False
With .Columns
With .Add("Item")
.Def(exCellValueFormat) = 1
.FormatColumn = "(len(parent(1 index ``)) ? (`<b><fgcolor gray>` + (1 pos ``) + `. ` + `</fgcolor></b>` + (%CC0 ? (`<a ` + (0 index ``) + `>`) :" & _
" ``) + `<img>` + (%CC0 ? (not %CX0 ? `expand` : `collapse`) : `empty`) + `:16</img>` + (%CC0 ? (`</a>`) : ``)) : ``) + ` ` + val" & _
"ue"
With .Editor
.EditType = EditType
.Option(exEditorAdjustPos) = "32 4 -4 -4"
End With
End With
End With
With .Items
hRoot = .AddItem("ACME Corporation")
.SelectableItem(hRoot) = False
.ExpandItem(hRoot) = True
h = .InsertItem(hRoot,,"Management")
.InsertItem h,,"CEO - Alice Brown"
.InsertItem h,,"COO - James Lee"
h = .InsertItem(hRoot,,"HR Department")
.InsertItem h,,"Recruiter - Jane Smith"
.InsertItem h,,"HR Assistant - Bob Green"
.ExpandItem(h) = True
h = .InsertItem(h,,"Engineering")
.InsertItem h,,"Software Team"
h = .InsertItem(h,,"Lead Developer - Mark H.")
.InsertItem h,,"Frontend Dev - Emily R."
.InsertItem h,,"Backend Dev - Tom W."
.InsertItem hRoot,,"QA Team"
End With
.EndUpdate
End With
|
|
1253
|
How can I reposition the +/- (expand/collapse) icon to show as "number, icon, text" (sample 1)

' AnchorClick event - Occurs when an anchor element is clicked.
Private Sub Grid1_AnchorClick(ByVal AnchorID As String, ByVal Options As String)
With Grid1
i = .FormatABC("int(value)",AnchorID)
With .Items
i = .ItemByIndex(i)
exp = .ExpandItem(i)
.ExpandItem(i) = Grid1.FormatABC("not value",exp)
End With
End With
End Sub
With Grid1
.BeginUpdate
.HTMLPicture("expand") = "gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYc7YYBY5vVBkiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyxgjsRzEKv1TqtXrNbrtfsIAwgASAH" & _
"AGShQwGQzGABUGEzudAqgyWdSmWw2Fw+sABSHI4AGH1XAGAxGAwywlI6eRqjGi1YuaJJEIJUHBPYqSJYKQAwCBDKbBPbncBibrUKQjGLFQo+TBFfR5GaUAR/KbGICyRx" & _
"siCOQClgdJxGoMpkGycpdDqUZ0EoJQJHYVoWCSCA4kEbRlHKRwJiYcYCH0PBNB2JwYCaCRsGcE8LDyfZKg+U59EsAZMlQCgJkcEA9CsywkiKJwiFcIQwEEgI="
.HTMLPicture("collapse") = "gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYU7YQBCooJSAiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzyO13dGEAGYzWcqlWrFarlesA3AGc" & _
"SAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWISpVLiXT5MrxiJyJJEIJUHBPYqSXYOQAgBgAB6jJwufxxX7YYhdYhFCSsSwSC4uMLoQajNJ" & _
"AG8QgZAgSIqGMCwRBkAJDicGwuiMeoHGeaRFlAU5qDwQQ6A+CYnlgPQeisGJfl4AJYhsRISjQYwJHIcpmmALAtlMEpkE4YBREmEpPBAARdicSw8AES5fi+fI5g+PpcAA" & _
"UJKgyCYknaZRrssJIiicIhXCEMBBICA=="
.HeaderVisible = False
.HasLines = exNoLine
.HasButtons = exNoButtons
.Indent = 12
.DefaultItemHeight = 24
.DrawGridLines = exHLines
.GridLineStyle = exGridLinesSolid
.GridLineColor = RGB(204,204,204)
.ShowFocusRect = False
.ExpandOnDblClick = False
.ExpandOnKeys = False
With .Columns
With .Add("Item")
.Def(exCellValueFormat) = 1
.FormatColumn = "(len(parent(1 index ``)) ? (`<b><fgcolor gray>` + (1 pos ``) + `. ` + `</fgcolor></b>` + `<a ` + (0 index ``) + `><img>` + (%CC" & _
"0 ? (not %CX0 ? `expand` : `collapse`) : ``) + `:16</img></a>`) : ``) + ` ` + value"
End With
End With
With .Items
hRoot = .AddItem("ACME Corporation")
.SelectableItem(hRoot) = False
.ExpandItem(hRoot) = True
h = .InsertItem(hRoot,,"Management")
.InsertItem h,,"CEO - Alice Brown"
.InsertItem h,,"COO - James Lee"
h = .InsertItem(hRoot,,"HR Department")
.InsertItem h,,"Recruiter - Jane Smith"
.InsertItem h,,"HR Assistant - Bob Green"
.ExpandItem(h) = True
h = .InsertItem(h,,"Engineering")
.InsertItem h,,"Software Team"
h = .InsertItem(h,,"Lead Developer - Mark H.")
.InsertItem h,,"Frontend Dev - Emily R."
.InsertItem h,,"Backend Dev - Tom W."
.InsertItem hRoot,,"QA Team"
End With
.EndUpdate
End With
|
|
1252
|
Expandable bullet list

' AnchorClick event - Occurs when an anchor element is clicked.
Private Sub Grid1_AnchorClick(ByVal AnchorID As String, ByVal Options As String)
With Grid1
i = .FormatABC("int(value)",AnchorID)
With .Items
i = .ItemByIndex(i)
exp = .ExpandItem(i)
.ExpandItem(i) = Grid1.FormatABC("not value",exp)
End With
End With
End Sub
With Grid1
.BeginUpdate
.HTMLPicture("expand") = "gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYM7YIBXCRNbtiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzZO13dGEAGYzWcqlWrFarlesA3AGc" & _
"SAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWNa6awbST7DBTiLyJJEIJUHBPUqSGJuYYwCAES5pBiQfyEX4QKAFH6QSihJQ/GZlET1FhIcg" & _
"GnUdoVHMmxajSIghlMKhsGiAAFggQ5dmKcRHEUEhbFAFQBgacABmAAJgAAcAJkAZgNjUcwDFecYcD8QoIDsGJjD6aYaGyHI7mqLRfgGfBcg+TYggkEhakQThtFsEpAE2" & _
"Xh7goSIJiSHp6haKgPGOXx3j+c5hiKLpri6JAPHWYJREuFJkBCYxcFeYS7ikJQzG0ZIVGKMBYGsVwXDWVQHjqfpjAoYpyE4Z5vH2YoHDkZwzkkUxHC8pwCgifIHBCdk4" & _
"GMLQVmcXJVhicxWi4IIUiKSQ1A8cBUj+eBEGCFQlFSIophiPRkFAWBLFALhwm+HhKjARpmgSGwNn4AIUCcZZUFEKoVmwywkiKJwiFcIQwEEgI"
.HTMLPicture("collapse") = "gCJKBOI4NBQaBQAhQNJJIIhShQACERCAIA0RD7zf5hiIBOZSI5CACuZwcdMRAhnIJNIMKWKPBb8MIFiIJOBILJzhQOYM7YIBXCRNbtiIYOhFLB0KZvMx0O5hORlABQM" & _
"JpNx0FxOIpUEA1FwxFw3RbWe45iK2MpYJJmJJJFQABERmgaAM0AMRJURDd1AF3hUQhQoAIDvsRAURGIBw8ThRaiJpQ4EwsKNURyzZO13dGEAGYzWcqlWrFarlesA3AGc" & _
"SAHAGShQwGQzGABUGEv2TAAFUGS26Uy2GwuH1wAKQ5HAAw+s4YwGIwGGWNa6awbST7DBTiLZJJEIJUHBPdpSGKOAQxCAzGhIBKfbAvUBsSIPbiVMhLTxJPK3banJB0N5" & _
"sA8VQRlmCRKjSCRaAIOgCiORISiWaI0DYLJPBYJBxB+LAqAMBRgAsIABjAAhYAOEB5kKDQ5kGZoaCaL5vH2KoEDCbpbDaWRrE8SopE+AA/DcMoZkgAgkhKERDlcdYEHA" & _
"JRzg4IpyCAKRyl6HZLGONwMEMb5clwWB3n2CZki6FoWC4cwQCbGYukKwhiAwOp3HIEJFGCNBGDyLArE8R56n4RUnlOShHGcXJdgcKQlCOSRdEcLw8DmAoInyexvFeMRG" & _
"G0DARmsbRZmsfRxleFZeHoD4eEKKRxGmPANgAC5xDAWpYHMW4uCGywkiKJwiFcIQwEEgI"
.HeaderVisible = False
.HasLines = exNoLine
.HasButtons = exNoButtons
.Indent = 12
.DefaultItemHeight = 24
.DrawGridLines = exHLines
.GridLineStyle = exGridLinesSolid
.GridLineColor = RGB(204,204,204)
.ShowFocusRect = False
.ExpandOnDblClick = False
.ExpandOnKeys = False
With .Columns
With .Add("Item")
.Def(exCellValueFormat) = 1
.FormatColumn = "(len(parent(1 index ``)) ? (`<b><fgcolor gray>` + (1 pos ``) + `. ` + `</fgcolor></b>` + `<a ` + (0 index ``) + `><img>` + (%CC" & _
"0 ? (not %CX0 ? `expand` : `collapse`) : `collapse`) + `:16</img></a>`) : ``) + ` ` + value"
With .Editor
.EditType = EditType
.Option(exEditorAdjustPos) = "32D 4D -4D -4D"
End With
End With
End With
With .Items
hRoot = .AddItem("ACME Corporation")
.SelectableItem(hRoot) = False
.ExpandItem(hRoot) = True
h = .InsertItem(hRoot,,"Management")
.InsertItem h,,"CEO - Alice Brown"
.InsertItem h,,"COO - James Lee"
h = .InsertItem(hRoot,,"HR Department")
.InsertItem h,,"Recruiter - Jane Smith"
.InsertItem h,,"HR Assistant - Bob Green"
.ExpandItem(h) = True
h = .InsertItem(h,,"Engineering")
.InsertItem h,,"Software Team"
h = .InsertItem(h,,"Lead Developer - Mark H.")
.InsertItem h,,"Frontend Dev - Emily R."
.InsertItem h,,"Backend Dev - Tom W."
.InsertItem hRoot,,"QA Team"
End With
.EndUpdate
End With
|
|
1251
|
Does grouping support multi-column sorting

With Grid1
.BeginUpdate
.SingleSort = False
.HeaderVisible = False
.DrawGridLines = exRowLines
.GridLineStyle = exGridLinesSolid
.AllowGroupBy = True
.Columns.Add "Prefix"
.Columns.Add "Region"
.Columns.Add "City"
With .Columns.Add("Sort")
.ComputedField = "%1 + %2"
.Visible = False
End With
With .Items
h = .AddItem("+33")
.CellValue(h,1) = "Corsica"
.CellValue(h,2) = "Bastia "
h = .AddItem("+33")
.CellValue(h,1) = "Occitanie"
.CellValue(h,2) = "Toulouse "
h = .AddItem("+33")
.CellValue(h,1) = "Corsica"
.CellValue(h,2) = "Ajaccio"
h = .AddItem("+33")
.CellValue(h,1) = "Occitanie"
.CellValue(h,2) = "Carcassonne "
End With
.Layout = "multiplesort=""C0:2"";singlesort=""C3:1"";"
.EndUpdate
End With
|
|
1250
|
How can I vertically scroll the control
With Grid1
.BeginUpdate
.ColumnAutoResize = False
.DataSource = CreateObject("DAO.DBEngine.120").OpenDatabase("C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb").OpenRecordset("Orders").OpenDatabase("C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.accdb").OpenRecordset("Orders")
.Layout = "Collapse="""";VScroll=10"
.EndUpdate
End With
|
|
1249
|
Export the items as a two-dimensional array

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.PutItems .Export("array","all")
.EndUpdate
End With
|
|
1248
|
Export only expanded items

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","only(expanded)") )
End With
|
|
1247
|
Export only selectable, sortable leaf items that are neither locked nor dividers

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","only(leaf,sortable,selectable,!divider,!locked)") )
End With
|
|
1246
|
Export only non-divider items

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","only(!divider)") )
End With
|
|
1245
|
Export only selectable items

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","only(selectable)") )
End With
|
|
1244
|
Export only sortable, but not locked items

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","only(sortable,!locked)") )
End With
|
|
1243
|
Export only checked items on specified column

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","only(checked[0])") )
End With
|
|
1242
|
Export only filtered, not locked or divider items

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","only(visible,!locked,!divider)") )
End With
|
|
1241
|
Export only selected items

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","only(selected)") )
End With
|
|
1240
|
Export only locked items

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","only(locked)") )
End With
|
|
1239
|
Export the leaf items of the control, excluding parent or grouped items

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","leaf") )
End With
|
|
1238
|
Export all checked and visible items (the first column in the columns list specifies the index of the column used to query the checkbox state)

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","chk") )
End With
|
|
1237
|
Export the selected-items

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","sel") )
End With
|
|
1236
|
Export the visible items, excluding child items of collapsed elements, non-visible items (such as those with a height of 0), and items that do not match the current filter

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","vis") )
End With
|
|
1235
|
Export all items, including the hidden or collapsed items

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.ScrollBySingleLine = True
.LinesAtRoot = exGroupLinesOutside
With .Columns
With .Add("Desc")
.Width = 32
.Def(exCellHasCheckBox) = True
End With
With .Add("Amount")
.Def(exTotalColumn) = "sum(current,rec,%1)"
.FormatColumn = "currency(value)"
End With
End With
With .Items
.LockedItemCount(exTop) = 1
h = .LockedItem(exTop,0)
.CellValue(h,0) = "All"
.CellValue(h,1) = "sum(all,rec,%1)"
.CellValueFormat(h,1) = exTotalField
r = .AddItem("Root 1")
g1 = .InsertItem(r,,"Group A")
.CellValue(.InsertItem(g1,,"Item 1"),1) = 1
.CellValue(.InsertItem(g1,,"Item 2"),1) = 2
.CellState(.ItemByIndex(3),0) = 1
g2 = .InsertItem(r,,"Group B")
.CellValue(.InsertItem(g2,,"Item 3"),1) = 3
.CellValue(.InsertItem(g2,,"Item 4"),1) = 4
.ExpandItem(g1) = True
.ExpandItem(r) = True
h = .AddItem("divider")
.ItemDivider(h) = 0
.SelectableItem(h) = False
.SortableItem(h) = False
.ItemHeight(h) = 1
r = .AddItem("Root 2")
g1 = .InsertItem(r,,"Group C")
.CellValue(.InsertItem(g1,,"Item 5"),1) = 5
.CellValue(.InsertItem(g1,,"Item 6"),1) = 6
.SelectItem(.ItemByIndex(2)) = True
End With
.EndUpdate
Debug.Print( .Export("","all") )
End With
|
|
1234
|
Bolds only the expanded items

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
.ConditionalFormats.Add("%CX0").Bold = True
.Columns.Add "Description"
With .Items
h = .AddItem("Root 1")
.InsertItem h,,"Child 1"
.InsertItem .InsertItem(h,,"Child 2"),,"Sub-Child 2"
.CellState(.InsertItem(h,,"Child 3"),0) = 1
.ExpandItem(h) = True
h = .AddItem("Root 2")
.InsertItem h,,"Child 1"
.InsertItem h,,"Child 2"
.InsertItem h,,"Child 3"
End With
.EndUpdate
End With
|
|
1233
|
Displays the root item's index and value/caption using expressions

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
.AutoDrag = exAutoDragPositionAny
.AllowCopyPaste = AllowCopyPasteEnum.exAllowPaste Or AllowCopyPasteEnum.exAllowCut Or AllowCopyPasteEnum.exAllowCopy
.SingleSel = False
.DrawGridLines = exRowLines
.GridLineStyle = exGridLinesSolid
.GridLineColor = RGB(208,208,208)
.ConditionalFormats.Add("%CC0 and %CX0").Bold = True
With .ConditionalFormats.Add("1")
.Bold = True
.ApplyTo = &H2
End With
With .Columns.Add("Description")
.Def(exCellHasCheckBox) = True
.PartialCheck = True
End With
With .Columns.Add("Index")
.FormatColumn = "1 index ``"
.Position = 0
.Width = 16
End With
With .Columns.Add("Root-Index")
.FormatColumn = "root(1 index ``)"
.Position = 1
.Width = 32
.Def(exCellBackColor) = 15790320
End With
With .Columns.Add("Root-Value")
.FormatColumn = "root(%0)"
.Position = 2
.Width = 32
.Def(exCellBackColor) = 15790320
End With
With .Items
h = .AddItem("Root 1")
.InsertItem h,,"Child 1"
.InsertItem .InsertItem(h,,"Child 2"),,"Sub-Child 2"
.CellState(.InsertItem(h,,"Child 3"),0) = 1
.ExpandItem(h) = True
h = .AddItem("Root 2")
.InsertItem h,,"Child 1"
.InsertItem h,,"Child 2"
.InsertItem h,,"Child 3"
.ExpandItem(h) = True
End With
.EndUpdate
End With
|
|
1232
|
Displays the parent item's index and caption/value using expressions

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
.AutoDrag = exAutoDragPositionAny
.AllowCopyPaste = AllowCopyPasteEnum.exAllowPaste Or AllowCopyPasteEnum.exAllowCut Or AllowCopyPasteEnum.exAllowCopy
.SingleSel = False
.DrawGridLines = exRowLines
.GridLineStyle = exGridLinesSolid
.GridLineColor = RGB(208,208,208)
.ConditionalFormats.Add("%CC0 and %CX0").Bold = True
With .ConditionalFormats.Add("1")
.Bold = True
.ApplyTo = &H2
End With
With .Columns.Add("Description")
.Def(exCellHasCheckBox) = True
.PartialCheck = True
End With
With .Columns.Add("Index")
.FormatColumn = "1 index `I`"
.Position = 0
.Width = 16
End With
With .Columns.Add("Parent-Index")
.FormatColumn = "parent(1 index `I`)"
.Position = 1
.Width = 32
.Def(exCellBackColor) = 15790320
End With
With .Columns.Add("Parent-Value")
.FormatColumn = "parent(%0)"
.Position = 2
.Width = 32
.Def(exCellBackColor) = 15790320
End With
With .Items
h = .AddItem("Root 1")
.InsertItem h,,"Child 1"
.InsertItem .InsertItem(h,,"Child 2"),,"Sub-Child 2"
.CellState(.InsertItem(h,,"Child 3"),0) = 1
.ExpandItem(h) = True
h = .AddItem("Root 2")
.InsertItem h,,"Child 1"
.InsertItem h,,"Child 2"
.InsertItem h,,"Child 3"
.ExpandItem(h) = True
End With
.EndUpdate
End With
|
|
1231
|
Copying and Pasting the Selection Programmatically
With Grid1
.BeginUpdate
.Columns.Add "Tasks"
.LinesAtRoot = exLinesAtRoot
.SingleSel = False
With .Items
.AddItem "Tasks"
.SelectItem(.AddItem("Task 1")) = True
.SelectItem(.AddItem("Task 2")) = True
End With
.IndentSelection False
.CopySelection
.Items.UnselectAll
.Paste
.EndUpdate
End With
|
|
1230
|
Enable Copy, Cut and Paste Clipboard operations
With Grid1
.BeginUpdate
.Columns.Add "Tasks"
.LinesAtRoot = exLinesAtRoot
.AllowCopyPaste = AllowCopyPasteEnum.exAllowPaste Or AllowCopyPasteEnum.exAllowCut Or AllowCopyPasteEnum.exAllowCopy
.SingleSel = False
With .Items
.AddItem "Tasks"
.SelectItem(.AddItem("Task 1")) = True
.SelectItem(.AddItem("Task 2")) = True
End With
.IndentSelection False
.EndUpdate
End With
|
|
1229
|
Adjusts the hierarchy of selected items by changing their parent

With Grid1
.BeginUpdate
.Columns.Add "Tasks"
.LinesAtRoot = exLinesAtRoot
.SingleSel = False
With .Items
.AddItem "Tasks"
.SelectItem(.AddItem("Task A")) = True
.SelectItem(.AddItem("Task B")) = True
End With
.IndentSelection False
.EndUpdate
End With
|
|
1228
|
Specify the size of the Columns panel

With Grid1
.BeginUpdate
.HeaderHeight = 24
.HeaderAppearance = Etched
With .Columns
.Add "City"
.Add("Start").Visible = False
.Add("End").Visible = False
End With
.ColumnsFloatBarRect = ",,96"
.ColumnsFloatBarVisible = ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleAsChild Or ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleIncludeCheckColumns
.EndUpdate
End With
|
|
1227
|
Show a vertical line between pivot and Columns panel (EBN color)

With Grid1
.BeginUpdate
.VisualAppearance.Add 1,"gBFLBCJwBAEHhEJAAEhABRsIQAAYAQGKIYBkAKBQAGaAoDDUNQxQwAAxwfBMKgBBCLIxhEYobgmGIXRpFICQTIcBhaGIZRiAKCRTDmHwyRCNIwCLD8QxtDqBY4gOZZX" & _
"hal4cJTgMaBYi+Pw3DZHcbvBRkewzHQAKgnSjoDhEMg1CTVVYTDKdOSzDyEX7sIAACpOIZQVJVEY1VT8cyxIyEZimSypWqiYJ0Ty6cQwTAIgI"
.Background(exColumnsFloatBackColor) = &H1000000
.HeaderHeight = 24
.HeaderAppearance = Etched
With .Columns
.Add "City"
.Add("Start").Visible = False
.Add("End").Visible = False
End With
.ColumnsFloatBarVisible = ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleAsChild Or ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleIncludeCheckColumns
.EndUpdate
End With
|
|
1226
|
Change the background of the Columns panel (EBN color)

With Grid1
.BeginUpdate
.VisualAppearance.Add 1,"gBFLBCJwBAEHhEJAAEhABNoCg6AADACAxRDAMgBQKAAzQFAYahqGKGAAGOD4JhUAIIRZGMIjFDcEwxC6NIpAWLoJDCH4mSTHYxgJIMWwzDiBZgkCA4fiGEYnThCIxzT" & _
"J0aw1CKbYRAKCUKoUAJFsSnQAJIgOO4lULPMIhDDQKQTIKBahoehqIhaEQyDSJNb2DCIahhMSEbKtCooDhGFZUWzLVxTJJNawHJqJJDuOTpSjKH4+RjWFKUXR9b4BJSN" & _
"AgqeCQTiSWZEVxRUS0XbGCyZLSQY7uAAMKgOVoDYzdGLwHTtOwrMa1QAsDSbKqWZ5uRpHcQ5aAGN5DPbMbqwOaqLznAaLQLtG4RTikVRPTDYaj437+OaHGyNbI6HTNPp" & _
"TlWDJWjYXI8l8C4fg6GYAAEEISgGJJGHQOocgyIwYnqKhYAAIQTH2MYRjQJBRAmZptmEAYIjGU5dk8UgOFgBJUgCTQIBYBoBmCCAmAqApghgDJUDmYQFCCZoEk2OBUm+" & _
"BZPCgZgagaYZIHYHoHmGWBcm8NwiEiFJVgmYgji4Kg6GKSI2C6C5jAiRgygwIojiycINkyeJmAYPJjkiTg+g+ZAIkCdIQkyWQWDuDxkBkJhKguZAzlIRQzGQc5ODWFJl" & _
"EkVhWhWZYJFYTYTmUE4yF6F5mAmBhihiZhJhYX4WmQaAUnWGpOlmNhuhuZwJkYcocmcSY4naHZlkmKhrDuJ5JnYfofmgCgGgKIJnlmXJ2h4TQKBosRokoNoOiOaQKDSd" & _
"4kmiChMncPBpgoZoaiaaZKHaHonmmE5iiKJRpDicomimaoKiaKoqmqSoeiIPgogqPotiyaxKlYPA+GuCqbBMa5KnaPovmwCwGj6LgP24RIhiyCwmkqMpsksNpKD6LQLB" & _
"qOIzi0SxWlaHZtAOahPssM5Wi+IYtlsXpijKbZ5lyTo5mAE4UlqOpjHOQpEjubyanKPJvEuNgVj2TY1CCao+k2G52AyP5wAwBp9DYZZ1CCaxsAABAEICA"
.Background(exColumnsFloatBackColor) = &H1000000
.HeaderHeight = 24
.HeaderAppearance = Etched
With .Columns
.Add "City"
.Add("Start").Visible = False
.Add("End").Visible = False
End With
.ColumnsFloatBarVisible = ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleAsChild Or ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleIncludeCheckColumns
.EndUpdate
End With
|
|
1225
|
Change the background of the Columns panel (solid color)

With Grid1
.BeginUpdate
.HeaderHeight = 24
.HeaderAppearance = Etched
With .Columns
.Add "City"
.Add("Start").Visible = False
.Add("End").Visible = False
End With
.ColumnsFloatBarVisible = ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleAsChild Or ColumnsFloatBarVisibleEnum.exColumnsFloatBarVisibleIncludeCheckColumns
.Background(exColumnsFloatBackColor) = RGB(240,240,240)
.EndUpdate
End With
|
|
1224
|
Change the visual appearance of the Columns panel

With Grid1
.BeginUpdate
.VisualAppearance.Add 1,"gBFLBCJwBAEHhEJAAEhABNoCg6AADACAxRDAMgBQKAAzQFAYahqGKGAAGOD4JhUAIIRZGMIjFDcEwxC6NIpAWLoJDCH4mSTHYxgJIMWwzDiBZgkCA4fiGEYnThCIxzT" & _
"J0aw1CKbYRAKCUKoUAJFsSnQAJIgOO4lULPMIhDDQKQTIKBahoehqIhaEQyDSJNb2DCIahhMSEbKtCooDhGFZUWzLVxTJJNawHJqJJDuOTpSjKH4+RjWFKUXR9b4BJSN" & _
"AgqeCQTiSWZEVxRUS0XbGCyZLSQY7uAAMKgOVoDYzdGLwHTtOwrMa1QAsDSbKqWZ5uRpHcQ5aAGN5DPbMbqwOaqLznAaLQLtG4RTikVRPTDYaj437+OaHGyNbI6HTNPp" & _
"TlWDJWjYXI8l8C4fg6GYAAEEISgGJJGHQOocgyIwYnqKhYAAIQTH2MYRjQJBRAmZptmEAYIjGU5dk8UgOFgBJUgCTQIBYBoBmCCAmAqApghgDJUDmYQFCCZoEk2OBUm+" & _
"BZPCgZgagaYZIHYHoHmGWBcm8NwiEiFJVgmYgji4Kg6GKSI2C6C5jAiRgygwIojiycINkyeJmAYPJjkiTg+g+ZAIkCdIQkyWQWDuDxkBkJhKguZAzlIRQzGQc5ODWFJl" & _
"EkVhWhWZYJFYTYTmUE4yF6F5mAmBhihiZhJhYX4WmQaAUnWGpOlmNhuhuZwJkYcocmcSY4naHZlkmKhrDuJ5JnYfofmgCgGgKIJnlmXJ2h4TQKBosRokoNoOiOaQKDSd" & _
"4kmiChMncPBpgoZoaiaaZKHaHonmmE5iiKJRpDicomimaoKiaKoqmqSoeiIPgogqPotiyaxKlYPA+GuCqbBMa5KnaPovmwCwGj6LgP24RIhiyCwmkqMpsksNpKD6LQLB" & _
"qOIzi0SxWlaHZtAOahPssM5Wi+IYtlsXpijKbZ5lyTo5mAE4UlqOpjHOQpEjubyanKPJvEuNgVj2TY1CCao+k2G52AyP5wAwBp9DYZZ1CCaxsAABAEICA"
.Background(exColumnsFloatAppearance) = &H1000000
.Background(exColumnsFloatCaptionBackColor) = RGB(246,246,246)
.BackColorHeader = &H1000000
.HeaderHeight = 24
.HeaderAppearance = Etched
With .Columns
.Add "City"
.Add("Start").Visible = False
.Add("End").Visible = False
End With
.Description(exColumnsFloatBar) = "Show/Hide"
.ColumnsFloatBarVisible = exColumnsFloatBarVisibleIncludeCheckColumns
.EndUpdate
End With
|
|
1223
|
Defines the symbol used to indicate repeated captions, providing a clear visual cue for identical entries (ditto mark)

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.DrawGridLines = exRowLines
.Columns.Add("Country").ShowIdem = "<fgcolor gray>〃"
With .Items
.AddItem "Spain"
.AddItem "Spain"
.AddItem "Spain"
.AddItem "Spain"
.AddItem "Germany"
.AddItem "Germany"
.AddItem "Germany"
.AddItem "Germany"
End With
.EndUpdate
End With
|
|
1222
|
Defines the symbol used to indicate repeated captions, providing a clear visual cue for identical entries (space)

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.DrawGridLines = exRowLines
.Columns.Add("Country").ShowIdem = " "
With .Items
.AddItem "Spain"
.AddItem "Spain"
.AddItem "Spain"
.AddItem "Spain"
.AddItem "Germany"
.AddItem "Germany"
.AddItem "Germany"
.AddItem "Germany"
End With
.EndUpdate
End With
|
|
1221
|
Displays a glitch funnel for drop-down filter buttons (empty or active)

With Grid1
.BeginUpdate
With .VisualAppearance
.RenderType = -1
.Add 1,"gBFLBCJwBAEHhEJAAEhABa8IQAAYAQGKIYBkAKBQAGaAoDDUNQxQwAAxwfBMKgBBCLIxhEYobgmGIXRpFMbxCKQahLEiTIhGUYJHgmK4tRiAUgxVDkBxrECZYqjcBZO" & _
"iwLQ2TxDM7DNKUCBnIoABhGOaYDh+IQNQjUFKwTRFGRxK4EIRKAyTDLQdRyGSMMbjdQpBCbMiMRqhESKRq2UwYRYCFS1NalaztO6BUAvK67YrWez/YBfF+SfwGeqDYRe" & _
"WAPfgWERnQrGMLxbD8KwZAKTRjkGJ4XhuB41TbQMqufL9ByXHKSSDpGjaXjeO5VVjYNAvS69UzXNq3bhtQAOXCMEwCgI="
.Add 2,"CP:1 -2 0 0 0"
End With
.DrawGridLines = exAllLines
.GridLineStyle = exGridLinesGeometric
.ShowFocusRect = False
.Background(exHeaderFilterBarButton) = &H2000000
.Background(exHeaderFilterBarActive) = &H2000001
.HeaderAppearance = Etched
.BackColorHeader = RGB(255,255,255)
.HeaderHeight = 24
.HeaderVisible = 1
With .Columns.Add("1st col")
.DisplayFilterButton = True
.DisplayFilterPattern = False
.Filter = "Item B"
.FilterType = exFilter
End With
.Columns.Add "2nd col"
With .Items
.AddItem "Item A"
.AddItem "Item B"
.AddItem "Item C"
End With
.ApplyFilter
.EndUpdate
End With
|
|
1220
|
How can I store any extra data associated with a cell
' ButtonClick event - Occurs when user clicks on the cell's button.
Private Sub Grid1_ButtonClick(ByVal Item As EXGRIDLibCtl.HITEM, ByVal ColIndex As Long, ByVal Key As Variant)
With Grid1
Debug.Print( .Items.CellData(Item,ColIndex) )
End With
End Sub
With Grid1
.BeginUpdate
.HeaderAppearance = Etched
With .Columns.Add("Def").Editor
.EditType = ButtonType
.Locked = True
End With
With .Items
.CellData(.AddItem("Cell 1"),0) = "your extra data for cell 1"
.CellData(.AddItem("Cell 2"),0) = "your extra data for cell 2"
End With
.EndUpdate
End With
|
|
1219
|
How can I replace or add an icon at runtime

With Grid1
.BeginUpdate
.ReplaceIcon "gAAAABgYACEHgUJFEEAAWhUJCEJEEJggEhMCYEXjUbjkJQECj8gj8hAEjkshYEpk8kf8ClsulsvAExmcvf83js5nU7nkCeEcn8boMaocXosCB9Hn09pkzcEuoL/fE+O" & _
"kYB0gB9YhIHrddgVcr9aktZADAD8+P8CgIA=="
.ReplaceIcon "C:\images\favicon.ico",0
.Columns.Add("Items").Def(exCellValueFormat) = 1
.Items.AddItem "Item <img>1</img>"
.EndUpdate
End With
|
|
1218
|
How can I save the changes, such as column's width, order

' Click event - Occurs when the user presses and then releases the left mouse button over the grid control.
Private Sub Grid1_Click()
With Grid1
.Layout = "Select=""0"";SingleSort=""C0:2"";Columns=1"
End With
End Sub
With Grid1
.BeginUpdate
.Columns.Add "Column"
With .Items
.AddItem "Item 1"
.AddItem "Item 2"
.AddItem "Item 3"
End With
.EndUpdate
End With
|
|
1217
|
How can I add totals to groups without having to go through the AddGroupItem grid function

With Grid1
.FreezeEvents True
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
With .ConditionalFormats
With .Add("%CT1")
.ForeColor = RGB(128,128,128)
.ApplyTo = &H1
End With
With .Add("%CT2")
.ForeColor = RGB(128,128,128)
.ApplyTo = &H2
End With
With .Add("%CT3")
.ForeColor = RGB(128,128,128)
.ApplyTo = &H3
End With
End With
With .Columns
.Add "Description"
With .Add("Qty")
.Editor.EditType = SpinType
.Def(exTotalColumn) = "sum(current,rec,%1)"
End With
With .Add("Price")
.Def(exTotalColumn) = "avg(current,rec,%2)"
.Editor.EditType = SpinType
End With
With .Add("Amount")
.ComputedField = "%1 * %2"
.Def(exTotalColumn) = "sum(current,rec,%3)"
End With
End With
With .Items
r = .AddItem("Root")
g1 = .InsertItem(r,,"Group 1")
h = .InsertItem(g1,,"Item 1")
.CellValue(h,1) = 1
.CellValue(h,2) = 10
h = .InsertItem(g1,,"Item 2")
.CellValue(h,1) = 2
.CellValue(h,2) = 11
g2 = .InsertItem(r,,"Group 2")
h = .InsertItem(g2,,"Item 1")
.CellValue(h,1) = 3
.CellValue(h,2) = 12
h = .InsertItem(g2,,"Item 2")
.CellValue(h,1) = 4
.CellValue(h,2) = 13
.ExpandItem(0) = True
End With
.EndUpdate
.FreezeEvents False
End With
|
|
1216
|
How can I configure the filters in the text columns to search by content

With Grid1
.BeginUpdate
.FilterBarPromptVisible = exFilterBarPromptVisible
.HeaderAppearance = None2
.FilterBarPromptType = exFilterPromptContainsAll
.Columns.Add "Names"
With .Items
.AddItem "Mantel"
.AddItem "Mechanik"
.AddItem "Motor"
.AddItem "Murks"
.AddItem "Märchen"
.AddItem "Möhren"
.AddItem "Mühle"
.AddItem "Sérigraphie"
End With
.FilterBarPromptPattern = "a"
.EndUpdate
End With
|
|
1215
|
How can I display the control's captions in Spanish

With Grid1
.BeginUpdate
.FilterBarPromptVisible = exFilterBarPromptVisible
.HeaderAppearance = None2
.Description(exFilterBarAll) = "(todo) "
.Description(exFilterBarFilterForCaption) = "filtrar por..."
.FilterBarPrompt = "<i><fgcolor=808080>iniciar filtro...</fgcolor></i>"
With .Columns.Add("Names")
.DisplayFilterButton = True
.FilterType = exPattern
End With
With .Items
.AddItem "Mantel"
.AddItem "Mechanik"
.AddItem "Motor"
.AddItem "Murks"
.AddItem "Märchen"
.AddItem "Möhren"
.AddItem "Mühle"
.AddItem "Sérigraphie"
End With
.EndUpdate
End With
|
|
1214
|
How can I zoom in the control

With Grid1
.BeginUpdate
s1 = 16
s2 = .FormatABC("2 * value",s1)
.ImageSize = s2
.DefaultItemHeight = s2
.HeaderHeight = s2
.SortBarHeight = s2
.Indent = s2
.Font.Size = s1
.FilterBarFont.Size = s1
.ToolTipFont.Size = s1
.FilterBarPromptVisible = exFilterBarPromptVisible
.HeaderAppearance = None2
With .Columns.Add("Names")
.DisplayFilterButton = True
.FilterType = exPattern
End With
With .Items
.AddItem "Mantel"
.AddItem "Mechanik"
.AddItem "Motor"
.AddItem "Murks"
.AddItem "Märchen"
.AddItem "Möhren"
.AddItem "Mühle"
.AddItem "Sérigraphie"
End With
.EndUpdate
End With
|
|
1213
|
Can I set a filter that automatically adds a * before and after the word, so the user can just search for 'cat' and it becomes '*cat*' automatically

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
With .Columns.Add("Items")
.DisplayFilterButton = True
.DisplayFilterPattern = True
.Def(exFilterPatternTemplate) = "*<%filter%>*"
.FilterType = exPattern
.Filter = "1"
End With
With .Items
h = .AddItem("Root 1")
.InsertItem h,,"Child 1"
.InsertItem h,,"Child 2"
.ExpandItem(h) = True
h = .AddItem("Root 2")
.InsertItem h,,"Child 1"
.InsertItem h,,"Child 2"
End With
.ApplyFilter
.EndUpdate
End With
|
|
1212
|
The fine dotted lines in the control appear much thicker than the standard ones we've been using. How can we fix this

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.DrawGridLines = exAllLines
.GridLineStyle = exGridLinesGeometric
.ColumnAutoResize = False
.Columns.Add "Column 1"
.Columns.Add "Column 2"
.Columns.Add "Column 3"
.Columns.Add "Column 4"
.EndUpdate
End With
|
|
1211
|
Load data as a tree using a parent-id relationship

With Grid1
.BeginUpdate
.ColumnAutoResize = False
.HeaderAppearance = Etched
.HeaderHeight = 24
.DrawGridLines = exVLines
.LinesAtRoot = exLinesAtRoot
Set rs = CreateObject("ADODB.Recordset")
With rs
.Open "Select * FROM Employees WHERE 1=0","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.mdb",3,3
End With
.DataSource = rs
.Columns.Item(0).Width = 128
Set rs = CreateObject("ADODB.Recordset")
With rs
.Open "Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExGrid\Sample\Access\misc.mdb",3,3
End With
.PutItems rs.GetRows(),";0;17"
.Items.ExpandItem(0) = True
.EndUpdate
End With
|
|
1210
|
Is there a way to change the contents of the drop down editor based on a value in another column

' AddItem event - Occurs after a new Item has been inserted to Items collection.
Private Sub Grid1_AddItem(ByVal Item As EXGRIDLibCtl.HITEM)
With Grid1
.Items.CellEditorVisible(Item,0) = exEditorVisible
.Items.CellEditorVisible(Item,1) = exEditorVisible
End With
End Sub
' EditOpen event - Occurs when the edit operation starts.
Private Sub Grid1_EditOpen()
With Grid1
With .Items
v = .CellValue(.FocusItem,0)
c = .CellCaption(.FocusItem,0)
End With
With .Columns.Item(1).Editor
.ClearItems
.AddItem v,c
End With
End With
End Sub
With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.GridLineStyle = exGridLinesGeometric
With .Columns.Add("DropDownList")
With .Editor
.EditType = DropDownListType
.AddItem 1,"First"
.AddItem 2,"Second"
.AddItem 3,"Third"
End With
End With
.DrawGridLines = exAllLines
.Columns.Add("DropDownList-Related").Editor.EditType = DropDownListType
With .Items
.CellValue(.AddItem(1),1) = -1
.CellValue(.AddItem(2),1) = -1
.CellValue(.AddItem(3),1) = -1
.LockedItemCount(exBottom) = 1
h = .LockedItem(exBottom,0)
.ItemDivider(h) = 0
.ItemDividerLineAlignment(h) = DividerTop
.CellEditorVisible(h,0) = exEditorHidden
.CellSingleLine(h,0) = exCaptionWordWrap
.CellValueFormat(h,0) = exHTML
.CellValue(h,0) = "The drop down editor in the second column is filled during the <b>EditOpen event</b>, and the values are based on the selection" & _
" on the first column."
End With
.EndUpdate
End With
|
|
1209
|
Highlight the editable fields

' Change event - Occurs when the user changes the cell's content.
Private Sub Grid1_Change(ByVal Item As EXGRIDLibCtl.HITEM, ByVal ColIndex As Long, NewValue As Variant)
With Grid1
.Refresh
End With
End Sub
With Grid1
.FreezeEvents True
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
With .ConditionalFormats
With .Add("%CE1")
.Bold = True
.BackColor = RGB(245,245,245)
.ApplyTo = &H1
End With
With .Add("%CE2")
.Bold = True
.BackColor = RGB(245,245,245)
.ApplyTo = &H2
End With
With .Add("%CE3")
.Bold = True
.BackColor = RGB(245,245,245)
.ApplyTo = &H3
End With
End With
With .Columns
.Add "Description"
With .Add("Qty")
.Editor.EditType = SpinType
.Def(exTotalColumn) = "sum(current,rec,%1)"
End With
With .Add("Price")
.Def(exTotalColumn) = "avg(current,rec,%2)"
.Editor.EditType = SpinType
End With
With .Add("Amount")
.ComputedField = "%1 * %2"
.Def(exTotalColumn) = "sum(current,rec,%3)"
End With
End With
With .Items
r = .AddItem("Root")
g1 = .InsertItem(r,,"Group 1")
h = .InsertItem(g1,,"Item 1")
.CellValue(h,1) = 1
.CellValue(h,2) = 10
h = .InsertItem(g1,,"Item 2")
.CellValue(h,1) = 2
.CellValue(h,2) = 11
g2 = .InsertItem(r,,"Group 2")
h = .InsertItem(g2,,"Item 1")
.CellValue(h,1) = 3
.CellValue(h,2) = 12
h = .InsertItem(g2,,"Item 2")
.CellValue(h,1) = 4
.CellValue(h,2) = 13
.ExpandItem(0) = True
End With
.EndUpdate
.FreezeEvents False
End With
|
|
1208
|
Highlight the total fields

' Change event - Occurs when the user changes the cell's content.
Private Sub Grid1_Change(ByVal Item As EXGRIDLibCtl.HITEM, ByVal ColIndex As Long, NewValue As Variant)
With Grid1
.Refresh
End With
End Sub
With Grid1
.FreezeEvents True
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
With .ConditionalFormats
With .Add("%CT1")
.ForeColor = RGB(128,128,128)
.ApplyTo = &H1
End With
With .Add("%CT2")
.ForeColor = RGB(128,128,128)
.ApplyTo = &H2
End With
With .Add("%CT3")
.ForeColor = RGB(128,128,128)
.ApplyTo = &H3
End With
End With
With .Columns
.Add "Description"
With .Add("Qty")
.Editor.EditType = SpinType
.Def(exTotalColumn) = "sum(current,rec,%1)"
End With
With .Add("Price")
.Def(exTotalColumn) = "avg(current,rec,%2)"
.Editor.EditType = SpinType
End With
With .Add("Amount")
.ComputedField = "%1 * %2"
.Def(exTotalColumn) = "sum(current,rec,%3)"
End With
End With
With .Items
r = .AddItem("Root")
g1 = .InsertItem(r,,"Group 1")
h = .InsertItem(g1,,"Item 1")
.CellValue(h,1) = 1
.CellValue(h,2) = 10
h = .InsertItem(g1,,"Item 2")
.CellValue(h,1) = 2
.CellValue(h,2) = 11
g2 = .InsertItem(r,,"Group 2")
h = .InsertItem(g2,,"Item 1")
.CellValue(h,1) = 3
.CellValue(h,2) = 12
h = .InsertItem(g2,,"Item 2")
.CellValue(h,1) = 4
.CellValue(h,2) = 13
.ExpandItem(0) = True
End With
.EndUpdate
.FreezeEvents False
End With
|
|
1207
|
Highlight the leaf items

With Grid1
.BeginUpdate
.ConditionalFormats.Add("%CC0=0").ForeColor = RGB(128,128,128)
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
With .Columns
.Add("Item").Width = 16
.Add "Desc"
End With
With .Items
hR = .AddItem("Root")
.CellValue(hR,1) = "The root directory /"
.ExpandItem(hR) = True
h = .InsertItem(hR,,"Home")
.CellValue(h,1) = "The home directory with user directories Alice and Bob"
.InsertItem h,,"Alice"
.InsertItem h,,"Bob"
.ExpandItem(h) = True
h = .InsertItem(hR,,"Etc")
.CellValue(h,1) = "The etc directory with one configuration file"
h = .InsertItem(h,,"nginx.conf")
.CellValue(.InsertItem(hR,,"Var"),1) = "The var directory"
End With
.EndUpdate
End With
|
|
1206
|
Highlight the parent items

With Grid1
.BeginUpdate
.ConditionalFormats.Add("%CC0").ForeColor = RGB(255,0,0)
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
With .Columns
.Add("Item").Width = 16
.Add "Desc"
End With
With .Items
hR = .AddItem("Root")
.CellValue(hR,1) = "The root directory /"
.ExpandItem(hR) = True
h = .InsertItem(hR,,"Home")
.CellValue(h,1) = "The home directory with user directories Alice and Bob"
.InsertItem h,,"Alice"
.InsertItem h,,"Bob"
.ExpandItem(h) = True
h = .InsertItem(hR,,"Etc")
.CellValue(h,1) = "The etc directory with one configuration file"
h = .InsertItem(h,,"nginx.conf")
.CellValue(.InsertItem(hR,,"Var"),1) = "The var directory"
End With
.EndUpdate
End With
|
|
1205
|
Highlight the item being expanded or collapsed

With Grid1
.BeginUpdate
.ConditionalFormats.Add("%CX0").Bold = True
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
With .Columns
.Add("Item").Width = 16
.Add "Desc"
End With
With .Items
hR = .AddItem("Root")
.CellValue(hR,1) = "The root directory /"
.ExpandItem(hR) = True
h = .InsertItem(hR,,"Home")
.CellValue(h,1) = "The home directory with user directories Alice and Bob"
.InsertItem h,,"Alice"
.InsertItem h,,"Bob"
.ExpandItem(h) = True
h = .InsertItem(hR,,"Etc")
.CellValue(h,1) = "The etc directory with one configuration file"
h = .InsertItem(h,,"nginx.conf")
.CellValue(.InsertItem(hR,,"Var"),1) = "The var directory"
End With
.EndUpdate
End With
|
|
1204
|
I am using exTotalColumn. Is there an option to exclude specific cells to display the total

' Change event - Occurs when the user changes the cell's content.
Private Sub Grid1_Change(ByVal Item As EXGRIDLibCtl.HITEM, ByVal ColIndex As Long, NewValue As Variant)
With Grid1
.Refresh
End With
End Sub
With Grid1
.FreezeEvents True
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
With .Columns
.Add "Description"
With .Add("Qty")
.Editor.EditType = SpinType
.Def(exTotalColumn) = "sum(current,rec,%1)"
End With
With .Add("Price")
.Def(exTotalColumn) = "avg(current,rec,%2)"
.Editor.EditType = SpinType
End With
With .Add("Amount")
.ComputedField = "%1 * %2"
.Def(exTotalColumn) = "sum(current,rec,%3)"
End With
End With
With .Items
r = .AddItem("Root")
g1 = .InsertItem(r,,"Group 1")
.FormatCell(g1,2) = "`<average missing>`"
.CellEditorVisible(g1,2) = exEditorHidden
.CellBold(g1,2) = True
.CellForeColor(g1,2) = RGB(255,0,0)
h = .InsertItem(g1,,"Item 1")
.CellValue(h,1) = 1
.CellValue(h,2) = 10
h = .InsertItem(g1,,"Item 2")
.CellValue(h,1) = 2
.CellValue(h,2) = 11
g2 = .InsertItem(r,,"Group 2")
h = .InsertItem(g2,,"Item 1")
.CellValue(h,1) = 3
.CellValue(h,2) = 12
h = .InsertItem(g2,,"Item 2")
.CellValue(h,1) = 4
.CellValue(h,2) = 13
.ExpandItem(0) = True
End With
.EndUpdate
.FreezeEvents False
End With
|
|
1203
|
How can I add a total column

' Change event - Occurs when the user changes the cell's content.
Private Sub Grid1_Change(ByVal Item As EXGRIDLibCtl.HITEM, ByVal ColIndex As Long, NewValue As Variant)
With Grid1
.Refresh
End With
End Sub
With Grid1
.FreezeEvents True
.BeginUpdate
.HeaderAppearance = Etched
.HeaderHeight = 24
.LinesAtRoot = exLinesAtRoot
With .Columns
.Add "Description"
With .Add("Qty")
.Editor.EditType = SpinType
.Def(exTotalColumn) = "sum(current,rec,%1)"
End With
With .Add("Price")
.Def(exTotalColumn) = "avg(current,rec,%2)"
.Editor.EditType = SpinType
End With
With .Add("Amount")
.ComputedField = "%1 * %2"
.Def(exTotalColumn) = "sum(current,rec,%3)"
End With
End With
With .Items
r = .AddItem("Root")
g1 = .InsertItem(r,,"Group 1")
h = .InsertItem(g1,,"Item 1")
.CellValue(h,1) = 1
.CellValue(h,2) = 10
h = .InsertItem(g1,,"Item 2")
.CellValue(h,1) = 2
.CellValue(h,2) = 11
g2 = .InsertItem(r,,"Group 2")
h = .InsertItem(g2,,"Item 1")
.CellValue(h,1) = 3
.CellValue(h,2) = 12
h = .InsertItem(g2,,"Item 2")
.CellValue(h,1) = 4
.CellValue(h,2) = 13
.ExpandItem(0) = True
End With
.EndUpdate
.FreezeEvents False
End With
|
|
1202
|
Is it possible to disable sizing(size) the column
With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.DrawGridLines = exVLines
With .Columns.Add("32px")
.Width = 32
.AllowSizing = False
End With
.Columns.Add "Rest"
.ColumnAutoResize = True
.EndUpdate
End With
|
|
1201
|
How can I add two columns of 25% and the third of 50%

With Grid1
.BeginUpdate
.HeaderAppearance = Etched
.DrawGridLines = exVLines
.Columns.Add("25%").Width = 25
.Columns.Add("25%").Width = 25
.Columns.Add("50%").Width = 50
.ColumnAutoResize = True
.EndUpdate
End With
|