LVSort - starts sorting items (this method works if Microsoft Internet Explorer 5.0 or higher is installed in the operating system, see also LVSortData);
LVSortData - starts sorting items. Unlike the LVSort method, it works on all Windows systems starting from Windows 95, but the OnCompareLVItems event handler does not receive the indexes of the compared items, but the LVItemData field of these items;
OnСompareLVItems - an event for comparing two items during sorting (LVSort and LVSortData). See the LVSortData description for details on accepted parameters;
LVSortColumn(i)- performs sorting by column. Works for Windows 98 and 2000 (and above, of course), and provides automatic sorting of strings in the order of the lexicographic order of the text in a given column;
LVIndexOf(s) and LVIndexOfW (s) - returns the index of the first element with the specified value of the label (element text), or -1 if no such element was found;
LVSearchFor(s, i, partial) and LVSearchForW (s, i, partial) - similar to the previous methods, it searches for an element with a specified string in the label, but allows you to specify after which element to start the search, and whether to compare strings in full, or only partially, by the first characters in a given search pattern;
In the MCK package for the general list, the TKOLListView mirror has a special editor for customizing the list of columns at the design stage (called, for example, by double-clicking on the list view rectangle on the form). But there is no editor for adding elements, you should add elements only with your own code at runtime.
If the columns for the list view object are created during the development of the form, then by default MCK provides an additional service: for each column, a symbolic constant with the name of the column is created, storing its index. It is convenient to use these constants in the code when referring to columns instead of directly specifying numeric indices. If you change the composition or order of the columns, in this case, you do not have to change the entire code.
|
However, if the column names are left as they are obtained by default (Col1, Col2, etc.), then if there are several objects of common lists on the form, there will certainly be a name conflict due to the redefinition of constants. To avoid this, you should either give your columns more meaningful names, or turn off the design-time generateConstants property (which makes sense if constants are not used anyway). |