This version adds some small features and fixes some bugs in 2.0 release.
New or changed features
ObjectListView.EnsureGroupVisible()
TreeView.UseWaitCursorWhenExpanding
propertyTreeListView
, some classes were changed from internal
to protected
so that they can be accessed by subclassesTreeRenderer
public so that it can be subclassedObjectListView.FinishCellEditing()
, ObjectListView.PossibleFinishCellEditing()
and
ObjectListView.CancelCellEditing()
are now publicTreeRenderer.LinePen
property to allow the connection drawing pen to be changed Bug fixes
TreeListView
HideSelection
is true
.RowHeight
so that it only changes the row height, not the width of the images.TreeListView
now works even when it doesn't have a SmallImageList
Version 2.0 is a major change over verion 1.x. If you have used ObjectListView before, you may need to do a little work to upgrade to version 2.
Major changes
TreeListView
which combines a tree structure with the columns on a ListView
. TypedObjectListView
which is a type-safe wrapper around an ObjectListView
. VirtualObjectListView
. In the first version, it was too difficult for programmers to actually use virtual lists. They had too many limitations, and those limitations that could be fixed were fixed in different ways. In v2.0, to use a VirtualObjectListView
, the programmer implements an IVirtualListDataSource
and gives that data source to the virtual list. Using that data source the virtual list can then perform just like a full-fledged ObjectListView
(without grouping or tile view, of course). The new version of FastObjectListView
and the new TreeListView
both make use of this new structure. ObjectListView
builds to a DLL, which can then be incorporated into your .NET project. This makes it much easier to use from other .NET languages (including VB). ListViewPrinter's
interaction with the IDE. All Pens
and Brushes
can now be specified through the IDE. CellToolTipGetter
and HeaderToolTipGetter
delegates respectively. BeforeSorting
, AfterSorting
, AspectNames
using TypedObjectListView.GenerateAspectGetters()
. The speed of hand-written AspectGetters
without the hand-written-ness. This is the most experimental part of the release. Thanks to Craig Neuwirt for his initial implementation. CheckBoxes
property was true). ObjectListViews
. The behavior was previously on available on virtual lists, and was turned off by default. Set IsSearchOnSortColumn
to false
to revert to v1.x behavior. CheckedAspectName
to allow check boxes to be get and set without requiring any code. CheckStateGetter
and CheckStatePutter
now use only CheckState
, rather than using both CheckState
and booleans
. Use BooleanCheckStateGetter
and BooleanCheckStatePutter
for behavior that is compatible with v1.x. FastObjectListViews
can no longer have a CustomSorter
. In v1.x it was possible, if tricky, to get a CustomSorter
to work with a FastObjectListView
, but that is no longer possible in v2.0 In v2.0, if you want to custom sort a FastObjectListView
, you will have to subclass FastObjectListDataSource
and override the SortObjects()
method. See here for an example. Major changes
FastObjectListViews
. .NET's ListView
cannot support checkboxes on virtual lists. We cannot get around this limit for plain VirtualObjectListViews
, but we can for FastObjectListViews
. This is a significant piece of work and there may well be bugs that I have missed. This implementation does not modify the traditional CheckedIndicies
/CheckedItems
properties, which will still fail. It uses the new CheckedObjects
property as the way to access the checked rows. Once CheckBoxes
is set on a FastObjectListView
, trying to turn it off again will throw an exception. CellEditValidating
event, which allows a cell editor to be validated before it loses focus. If validation fails, the cell editor will remain. Previous versions could not prevent the cell editor from losing focus. Thanks to Artiom Chilaru for the idea and the initial implementation.ObjectListView
is owner drawn. To see this in action, set the HighlightForegroundColor
and HighlightBackgroundColor
properties and then call EnableCustomSelectionColors()
.AlwaysGroupByColumn
and AlwaysGroupBySortOrder
properties, which force the list view to always be grouped by a particular column.Minor improvements
CheckObject()
and all its friends, as well as CheckedObject
and CheckedObjects
propertiesLastSortColumn
and LastSortOrder
properties.SORT_INDICATOR_UP_KEY
and SORT_INDICATOR_DOWN_KEY
public so they can be used to specify the image used on column headers when sorting. CopyObjectsToClipboard()
method out of CopySelectionToClipboard().
CopyObjectsToClipboard()
could now be used, for example, to copy all checked objects to the clipboard. MakeColumnSelectMenu().
RefreshItem()
to VirtualObjectListView
so that refreshing an object actually does something.AddObject(s)/RemoveObject(s)
methods. Previously, if SetObjects()
was given an ArrayList
that list was modified directly by the Add/RemoveObject(s)
methods. Now, a copy is always taken and modifying, leaving the original collection intact. Bug fixes (not a complete list)
GetItem()
on virtual lists where the item returned was not always complete . ObjectListView
from responding to right clicks when it was used within a UserControl
(thanks to Michael Coffey).SelectedObject
. GetAspectByName()
where chained aspects would crash if one of the middle aspects returned null (thanks to philippe dykmans). AddObject/AddObjects/RemoveObject/RemoveObjects
methods. These methods allow the programmer to add and remove specific model objects from the ObjectListView
. These methods work on ObjectListView
and FastObjectListView
. They have no effect on DataListView
and VirtualObjectListView
since the data source of both of these is outside the control of the ObjectListView. BusinessCardRenderer
in the demo for an example. In the demo, go to the Complex tab, turn on Owner Drawn, and switch to Tile view to see this in action.RenderDelegate
has changed. It now returns a boolean
to indicate if default rendering should be done. This delegate
previously returned void
. This is only important if your code used RendererDelegate
directly. Renderers derived from BaseRenderer
are unchanged.TopItemIndex
property now works with virtual listsMappedImageRenderer
will now render a collection of values ObjectListView
ListView
becomes confused about the scroll position, and incorrectly renders items after that. ObjectListView
now avoids this problemThe documentation available on this site was updated. The Cookbook section was expanded to include using checkboxes, caching images from a database, and customising the Tile view. Two new subsections were added: one explaining the details of cell editing, the other introducing the power of owner drawing.
ObjectListView was released on SourceForge.
Added SaveState() and RestoreState() to allow the visual state of an ObjectListView to be preserved between application runs.
ClearObjects()
, GetCheckedObject()
, GetCheckedObjects()
, a flavour of GetItemAt()
that returns the item and column under a point. Thanks for the suggestions, Chris.RowFormatter
. FastObjectListView
for all impatient programmers. FlagRenderer
to help with drawing bitwise-OR'ed flags (search for FlagRenderer
in the demo project to see an example) ObjectListView
knows about but that are not visible to the user. This is controlled by OLVColumn.IsVisible
. I added ColumnSelectionForm
to the demo project to show how it could be used in an application. Also, right clicking on the column header will allow the user to choose which columns are visible. Set SelectColumnsOnRightClick
to false
to prevent this behaviour. CopySelectionToClipboard()
which pastes a text and HTML representation of the selected rows onto the Clipboard. By default, this is bound to Ctrl-C. CheckStateGetter
and CheckStatePutter
properties. See ColumnSelectionForm
for an example of how to use. ImagesRenderer
to draw more than one image in a column. ObjectListView
and OLVColumn
into partial classes so that others can extend them. IncrementalUpdate()
method, which operates like SetObjects()
but without changing the scrolling position, the selection, or the sort order. And it does this without a single flicker. Good for lists that are updated regularly. [Better to use a FastObjectListView
and the Objects
property] SelectionChanged
event, which is triggered once per user action regardless of how many item are selected or deselected. In comparison, SelectedIndexChanged
events are triggered for every item that is selected or deselected. So, if 100 items are selected, and the user clicks a different item to select just that item, 101 SelectedIndexChanged
events will be triggered, but only one SelectionChanged
event. Thanks to lupokehl42 for this suggestion and improvements. SecondarySortColumn
and SecondarySortOrder
properties for details. There is no user interface for these items -- they have to be set by the programmer. ObjectListView
now handles RightToLeftLayout
correctly in owner drawn mode, for all you users of Hebrew and Arabic (still working on getting ListViewPrinter
to work, though). Thanks for dschilo for his help and input. ListViewPrinter
and owner drawn mode ObjectListViews
using ListViewPrinter
. DataListView
to now be a fully functional, data-bindable control. This is based on Ian Griffiths' excellent example, which should be available here, but unfortunately seems to have disappeared from the web. Thanks to ereigo for significant help with debugging this new code. ListView
is empty (obviously). This is controlled by the EmptyListMsg
and EmptyListMsgFont
properties. Have look at the "File Explorer" tab in the demo to see what it looks like. BuildList()
is called. This is on by default. GetNextItem()
and GetPreviousItem()
methods, which walk sequentially through the ListView
items, even when the view is grouped (thanks to eriego for the suggestion). SelectedItem
property and the GetColumn()
and GetItem()
methods. BuildList()
is 15% faster. VirtualObjectListView
(thanks to mpgjunky). DrawAlignedImage()
(thanks to krita970). ObjectListView
s now have a RowFormatter
delegate. This delegate is called whenever a ListItem
is added or refreshed. This allows the format of the item and its sub-items to be changed to suit the data being displayed, like red colour for negative numbers in an accounting package. The DataView
tab in the demo has an example of a RowFormatter
in action. Include any of these words in the value for a cell and see what happens: red, blue, green, yellow, bold, italic, underline, bk-red, bk-green. Be aware that using RowFormatter
and trying to have alternate coloured backgrounds for rows can give unexpected results. In general, RowFormatter
and UseAlternatingBackColors
do not play well together. ObjectListView
now has a RowHeight
property. Set this to an integer value and the rows in the ListView
will be that height. Normal ListView
s do not allow the height of the rows to be specified; it is calculated from the size of the small image list and the ListView
font. The RowHeight
property overrules this calculation by shadowing the small image list. This feature should be considered highly experimental. One known problem is that if you change the row height while the vertical scroll bar is not at zero, the control's rendering becomes confused. Image
to a column that has ImageRenderer
, the GIF will be animated. Like all renderers, this only works in OwnerDrawn
mode. See the DataView
tab in the demo for an example. ObjectListView
now supports all ListView.View
modes, not just Details
. The tile view has its own support built in. Owner.Workgroup.Name
is now a valid AspectName
. Thanks to OlafD for this suggestion and a sample implementation. ImageGetter
delegates can now return int
s, string
s or Image
objects, rather than just int
s as in previous versions. int
s and string
s are used as indices into the image lists. Images are only shown when in OwnerDrawn
mode. OLVColumn.MakeGroupies()
to simplify group partitioning. DataListView
. VirtualObjectListView
. Freeze()/Unfreeze()/Frozen
functionality. CustomSorter
delegate. SetObjects(null)
or having zero columns. SelectObject()
and GetSelectedObjects()
. if...else
cascade.