Article ID: 198232 - Last Review: December 11, 2003 - Revision: 3.0 PRB: Delete All Columns in the List ControlThis article was previously published under Q198232 On This PageSYMPTOMS
When you attempt to delete columns from the List control, you might receive
unexpected results. In particular, trying to delete all the columns in the
List control might not work.
CAUSE
Because of the internal design of the List control, this problem can occur
when you delete all the columns from a List control through a forward
iterating loop. For example, when you delete the column at index 0,
Column(0), the indices of all of the remaining columns decrement by one
(for example, Column(1) becomes Column(0)).
The following sample code does not delete all of the columns: RESOLUTION
If you want to delete all the columns in a loop, you need to delete the
columns in the reverse order in which they were added. So you need to have
a decrementing loop instead of an incrementing loop. If the total number
of columns is ten (0-9) in the List control, you need to start deleting
from the last column, Column(9), instead of the first, Column(0), as in the
following example:
STATUS
This behavior is by design.
MORE INFORMATIONSteps to Add and Delete All Columns from the List Control
REFERENCES | Article Translations
|
Back to the top
