« Item Hierarchy | Index | Items » |
Item reordering is not supported in Better ListView Express.
Changing item order by dragging items can be turned on by setting ItemReorderMode to one of the following values:
Item reordering is disabled (default value).
Item reordering is enabled and automatic.
Item reordering is enabled, but the actual reordering is up to the user.
The reordering is realized through Drag and Drop mechanism.
Item reordering can supports groups and item hierarchy.
Target location of reordered items is displayed using Insertion mark. If the reordering cannot be performed (e.g. when inserting item between its own children), then the insertion mark is displayed as disabled and the reordering will not be performed.
There are several item reordering options to adjust the feature for working with groups and hierarchical items. These options can be used as flags of the enumm property ItemReorderOptions:
Allow creating a child items by inserting item into another item without children.
Collapse item with children prior to reordering.
Do not change item groups when reordering.
Keep parent-child item relations when reordering.
No options are active.
Allow reordering items with same parent item only.
None of the extra options are on by default so the default value is ItemReorderOptions.None.
Auto expansion checking is performed during item reordering and looks whether it is valid to auto expand item over which mouse cursor hovers. By default, there is only one situation when auto expansion is not allowed: Item which is auto-collapsed will not be than auto-expanded again.
It is possible to add custom checking (e.g. when some items or groups should not expand when user drags items over it) by handling CheckAutoExpand event and than set BetterListViewCheckAutoExpandEventArgs.IsValid to false whenever you want to deny auto-expansion. Event data contains both source and target items.
Item reorder checking is performed during item reordering and looks whether an item is not put into itself (into its own children). For example, when AllowCreateChild reordering option is enabled, then the check looks whether user is not making child item under the reordered item.
It is possible to add custom checking (e.g. when item should not be placed some specific locations with item reordering) by handling CheckItemReorder event and then set BetterListViewCheckItemReorderEventArgs.IsValid to false. Event data contains source items, target location and current reordering options.
C#
this.listView.BeginUpdate();
this.listView.Columns.Add("column");
this.listView.Items.AddRange(
new[]
{
"first item",
"second item",
"third item",
"fourth item",
"fifth item"
});
// enable item reordering
this.listView.ItemReorderMode = BetterListViewItemReorderMode.Enabled;
this.listView.EndUpdate();
Visual Basic
ListView.BeginUpdate()
ListView.Columns.Add ("column")
ListView.Items.AddRange (
New String() { _
"first item",
"second item",
"third item",
"fourth item",
"fifth item"
})
' enable item reordering
ListView.ItemReorderMode = BetterListViewItemReorderMode.Enabled
ListView.EndUpdate()
« Item Hierarchy | Index | Items » |
Better ListView Express Documentation | Copyright © ComponentOwl.com |