Ribbon for WinForms | ComponentOne
C1.Win.Ribbon Namespace / RibbonGalleryItemCollection Class / BeginUpdate Method

In This Topic
    BeginUpdate Method (RibbonGalleryItemCollection)
    In This Topic
    Maintains performance while items are being added or removed from the collection.
    Syntax
    'Declaration
     
    
    Public Sub BeginUpdate() 
    public void BeginUpdate()
    Remarks

    When adding a large number of items to the collection, you should use the BeginUpdate method to prevent the collection from updating its internal state each time an item is added to the list. Once you have completed the task of adding items to the list, call the RibbonItemCollectionBase.EndUpdate method to resume regular processing.

    This way of adding items dramatically improves performance and is recommended when adding more than 10 or 20 items to the list.

    Example

    The code belows populates a RibbonComboBox with items containing the names of all the fonts installed in the system.

    You can run the sample as-is, then comment out the calls to BeginUpdate and EndUpdate to see the difference in performance.

    See Also