ComponentOne List 8.0 for ActiveX
Refreshing the Display

True DBList defers screen updates until they are needed by waiting until Windows enters an idle loop. This generally occurs when your code stops executing and the system is waiting for user input. You can simulate an idle loop in code by calling the Visual Basic function DoEvents, which causes all pending events to be processed.

In most cases, you need not be concerned with the list's display operations and can concentrate on writing code that works directly with the database. However, if the structure of your data source changes, or you need to temporarily keep the list from responding to database events, you can use the Refresh or ReBind methods.

If you are not using DataMode 1 - Unbound, these methods behave as follows:

Refresh

This method simply forces the list to repaint, and no database access occurs. The list maintains all modified data in the current row, and the current cell position is unchanged.

ReBind

This method causes the list to disconnect from and then reconnect to its data source. The list rebinds all columns and refetches all data. Any data changed by the user (but not yet updated to the database) will be lost. The list maintains the current row but not the current column. When data is redisplayed, the leftmost visible column becomes current, and the current row becomes the first row in the list (unless all records are visible).

If you need to refresh a single column or row instead of the entire list, you can use the RefreshCol or RefreshRow methods instead of Refresh. To refresh an individual list cell, use the RefreshCell method of the desired Column object.

To maintain backward compatibility with the original unbound mode of DBList, the Refresh and ReBind methods behave as follows when the DataMode property is set to 1 - Unbound:

Refresh

The list refetches and redisplays all data by firing the UnboundReadData event. Any data changed by the user (but not yet updated to the database) will be lost. The list maintains the current row but not the current column. When data is redisplayed, the leftmost visible column becomes current, and the current row becomes the first row in the list (unless all records are visible).

ReBind

The list refetches data by firing the UnboundReadData event, but it maintains any data changed by the user within the current row. When data is redisplayed, the current cell position and the list display are unchanged.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback