Type | Description |
Use the BeginUpdate and EndUpdate methods to avoid drawing the control while adding multiple groups. Use the group's BeginUpdate and EndUpdate method to maintain performance while adding new items to the group's list.
For instance, the following sample shows how to use the BeginUpdate and EndUpdate methods:
Set rs = CreateObject("ADODB.Recordset") rs.Open "Orders", "Provider=Microsoft.Jet.OLEDB.3.51;Data Source= D:\Program Files\Microsoft Visual Studio\VB98\NWIND.MDB", 3 ' Opens the table using static mode With ExplorerTree1 .BeginUpdate With .Groups.Add("Group 1") .BeginUpdate .ColumnAutoResize = False .HeaderVisible = True With .Columns .Clear For Each f In rs.Fields .Add f.Name Next End With .PutItems rs.GetRows() .EndUpdate End With With .Groups.Add("Group 2") .BeginUpdate .PutItems Array("Item 1", "Item 2", "Item 3") .EndUpdate End With .EndUpdate End With