C# Class BrightIdeasSoftware.ObjectListView

Inheritance: System.Windows.Forms.ListView, ISupportInitialize
Afficher le fichier Open project: soywiz/cspspemu Class Usage Examples

Méthodes publiques

Свойство Type Description
EditorRegistry EditorRegistry
SortAscendingImage Bitmap
SortDescendingImage Bitmap

Private Properties

Свойство Type Description
AddCheckStateBitmap void
ApplyHyperlinkStyle void
BuildBeforeSortingEventArgs BrightIdeasSoftware.BeforeSortingEventArgs
BuildCellEvent void
CalculateCellBounds System.Drawing.Rectangle
CalculateCheckState CheckState
CalculateToggledCheckState CheckState
ColumnSelectMenuClosing void
ColumnSelectMenuItemClicked void
DoSort void
FindGlassPanelForOverlay GlassPanelForm
GetCheckedObject object
GetCheckedObjects ArrayList
GetFirstNonNullValue object
GetSelectedObject object
GetSelectedObjects ArrayList
HandleHeaderRightClick bool
HandleModelOnPropertyChanged void
HeaderToolTipShowingCallback void
LowLevelScroll void
MakeResizedImage Bitmap
MakeResizedImageList ImageList
MakeSubItem OLVListSubItem
MakeTriangleBitmap Bitmap
PrepareAlternateBackColors void
RememberDisplayIndicies void
RunWhenIdle void
SetAllSubItemImages void
SetGroupSpacing void
SetupBaseImageList void
ShouldShowOverlays bool
ShowColumnCommandMenu void
ShowColumnSelectMenu void
StateToString string
SubscribeNotifications void
ToggleSelectedRowCheckBoxes void
UnsubscribeNotifications void

Méthodes publiques

Méthode Description
AddDecoration ( IDecoration decoration ) : void

Add the given decoration to those on this list and make it appear

A decoration scrolls with the listview. An overlay stays fixed in place.

AddObject ( object modelObject ) : void

Add the given model object to this control.

See AddObjects() for more details

AddObjects ( ICollection modelObjects ) : void

Add the given collection of model objects to this control.

The added objects will appear in their correct sort position, if sorting is active (i.e. if LastSortColumn is not null). Otherwise, they will appear at the end of the list.

No check is performed to see if any of the objects are already in the ListView.

Null objects are silently ignored.

AddOverlay ( IOverlay overlay ) : void

Add the given overlay to those on this list and make it appear

AutoResizeColumns ( ) : void

Resize the columns to the maximum of the header width and the data.

BuildGroups ( ) : void

Organise the view items into groups, based on the last sort column or the first column if there is no last sort column

BuildGroups ( OLVColumn column, SortOrder order ) : void

Organise the view items into groups, based on the given column

If the AlwaysGroupByColumn property is not null, the list view items will be organisd by that column, and the 'column' parameter will be ignored.

This method triggers sorting events: BeforeSorting and AfterSorting.

BuildGroups ( OLVColumn groupByColumn, SortOrder groupByOrder, OLVColumn column, SortOrder order, OLVColumn secondaryColumn, SortOrder secondaryOrder ) : void

Organise the view items into groups, based on the given columns

This method does not trigger sorting events. Use BuildGroups() to do that

BuildList ( ) : void

Build/rebuild all the list view items in the list, preserving as much state as is possible

BuildList ( bool shouldPreserveState ) : void

Build/rebuild all the list view items in the list

Use this method in situations were the contents of the list is basically the same as previously.

CalculateCellBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex ) : Rectangle

Return the bounds of the given cell

CalculateCellEditorBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Size preferredSize ) : Rectangle

Calculate the bounds of the edit control for the given item/column

CalculateCellTextBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex ) : Rectangle

Return the bounds of the given cell only until the edge of the current text

CalculateReasonableTileSize ( ) : void

Give the listview a reasonable size of its tiles, based on the number of lines of information that each tile is going to display.

CancelCellEdit ( ) : void

Stop editing a cell and throw away any changes.

ChangeToFilteredColumns ( View view ) : void

Rebuild this list for the given view

CheckIndeterminateObject ( object modelObject ) : void

Mark the given object as indeterminate check state

CheckIndeterminateSubItem ( object rowObject, OLVColumn column ) : void

Put an indeterminate check into the check box at the given cell

CheckObject ( object modelObject ) : void

Mark the given object as checked in the list

CheckObjects ( IEnumerable modelObjects ) : void

Mark the given objects as checked in the list

CheckSubItem ( object rowObject, OLVColumn column ) : void

Put a check into the check box at the given cell

ClearHotItem ( ) : void

Force the hot item to be recalculated

ClearObjects ( ) : void

Remove all items from this list

ClearUrlVisited ( ) : void

Reset the memory of which URLs have been visited

ConfigureAutoComplete ( TextBox tb, OLVColumn column ) : void

Configure the given text box to autocomplete unique values from the given column. At most 1000 rows will be considered.

ConfigureAutoComplete ( TextBox tb, OLVColumn column, int maxRows ) : void

Configure the given text box to autocomplete unique values from the given column. At most 1000 rows will be considered.

CopyObjectsToClipboard ( IList objectsToCopy ) : void

Copy a text and html representation of the given objects onto the clipboard.

CopySelectionToClipboard ( ) : void

Copy a text and html representation of the selected rows onto the clipboard.

Be careful when using this with virtual lists. If the user has selected 10,000,000 rows, this method will faithfully try to copy all of them to the clipboard. From the user's point of view, your program will appear to have hung.

CreateColumnFilter ( ) : IModelFilter

Create a filter that will enact all the filtering currently installed on the visible columns.

DeselectAll ( ) : void

Deselect all rows in the listview

DropSinkCanDrop ( object sender, OlvDropEventArgs e ) : void
DropSinkDropped ( object sender, OlvDropEventArgs e ) : void
DropSinkModelCanDrop ( object sender, ModelDropEventArgs e ) : void
DropSinkModelDropped ( object sender, ModelDropEventArgs e ) : void
EditSubItem ( OLVListItem item, int subItemIndex ) : void

Begin an edit operation on the given cell.

This performs various sanity checks and passes off the real work to StartCellEdit().

EnableCustomSelectionColors ( ) : void

Setup the list so it will draw selected rows using custom colours.

This method makes the list owner drawn, and ensures that all columns have at least a BaseRender installed.

EnsureGroupVisible ( ListViewGroup lvg ) : void

Scroll the listview so that the given group is at the top.

If the group is already visible, the list will still be scrolled to move the group to the top, if that is possible.

This only works when the list is showing groups (obviously).

This does not work on virtual lists, since virtual lists don't use ListViewGroups for grouping. Use VirtualObjectListView.EnsureNthGroupVisible instead.

EnsureModelVisible ( Object modelObject ) : void

Ensure that the given model object is visible

EnumerableToArray ( IEnumerable collection, bool alwaysCreate ) : ArrayList

Convert the given enumerable into an ArrayList as efficiently as possible

When we move to .NET 3.5, we can use LINQ and not need this method.

FindMatchingRow ( string text, int start, SearchDirectionHint direction ) : int

Find the first row after the given start in which the text value in the comparison column begins with the given text. The comparison column is column 0, unless IsSearchOnSortColumn is true, in which case the current sort column is used.

The text comparison is a case-insensitive, prefix match. The search will search the every row until a match is found, wrapping at the end if needed.

FinishCellEdit ( ) : void

Finish the cell edit operation, writing changed data back to the model object

This method does not trigger a Validating event, so it always finishes the cell edit.

FinishCellEdit ( bool expectingCellEdit ) : void

Finish the cell edit operation, writing changed data back to the model object

This method does not trigger a Validating event, so it always finishes the cell edit.

Freeze ( ) : void

Freeze the listview so that it no longer updates itself.

Freeze()/Unfreeze() calls nest correctly

GetCellToolTip ( int columnIndex, int rowIndex ) : String

Return the tooltip that should be shown when the mouse is hovered over the given cell

GetColumn ( int index ) : OLVColumn

Return the column at the given index

GetColumn ( string name ) : OLVColumn

Return the column at the given title.

GetDisplayOrderOfItemIndex ( int itemIndex ) : int

Return the display index of the given listviewitem index. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.

GetFilteredColumns ( View view ) : List

Return a collection of columns that are visible to the given view. Only Tile and Details have columns; all other views have 0 columns.

GetHeaderToolTip ( int columnIndex ) : String

Return the tooltip that should be shown when the mouse is hovered over the given column

GetItem ( int index ) : OLVListItem

Return the item at the given index

GetItemAt ( int x, int y, OLVColumn &hitColumn ) : OLVListItem

Find the item and column that are under the given co-ords

GetItemCount ( ) : int

Return the number of items in the list

GetLastItemInDisplayOrder ( ) : OLVListItem

Return the last item in the order they are shown to the user. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.

GetModelObject ( int index ) : object

Return the model object at the given index

GetNextItem ( OLVListItem itemToFind ) : OLVListItem

Return the ListViewItem that appears immediately after the given item. If the given item is null, the first item in the list will be returned. Return null if the given item is the last item.

GetNthItemInDisplayOrder ( int n ) : OLVListItem

Return the n'th item (0-based) in the order they are shown to the user. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.

GetPreviousItem ( OLVListItem itemToFind ) : OLVListItem

Return the ListViewItem that appears immediately before the given item. If the given item is null, the last item in the list will be returned. Return null if the given item is the first item.

GetSubItem ( int index, int columnIndex ) : OLVListSubItem

Return the sub item at the given index/column

HasDecoration ( IDecoration decoration ) : bool

Is the given decoration shown on this list

HasOverlay ( IOverlay overlay ) : bool

Is the given overlay shown on this list?

HideOverlays ( ) : void

Hide any overlays.

This is only a temporary hiding -- the overlays will be shown the next time the ObjectListView redraws.

HitTest ( int x, int y ) : ListViewHitTestInfo

Calculate what item is under the given point?

ISupportInitialize ( ) : void
IndexOf ( Object modelObject ) : int

Find the given model object within the listview and return its index

InsertObjects ( int index, ICollection modelObjects ) : void

Insert the given collection of objects before the given position

This operation only makes sense of non-sorted, non-grouped lists, since any subsequent sort/group operation will rearrange the list.

This method only works on ObjectListViews and FastObjectListViews.

IsChecked ( object modelObject ) : bool

Return true of the given object is checked

If the given object is not in the list, this method returns false.

IsCheckedIndeterminate ( object modelObject ) : bool

Return true of the given object is indeterminately checked

If the given object is not in the list, this method returns false.

IsEnumerableEmpty ( IEnumerable collection ) : bool
IsSelected ( object model ) : bool

Return true if the row representing the given model is selected

IsSubItemChecked ( object rowObject, OLVColumn column ) : bool

Is there a check at the check box at the given cell

IsUrlVisited ( string url ) : bool

Has the given URL been visited?

MakeColumnCommandMenu ( ToolStripDropDown strip, int columnIndex ) : ToolStripDropDown

Append the column selection menu items to the given menu strip.

MakeColumnSelectMenu ( ToolStripDropDown strip ) : ToolStripDropDown

Append the column selection menu items to the given menu strip.

MakeFilteringMenu ( ToolStripDropDown strip, int columnIndex ) : ToolStripDropDown

Create a Filtering menu

MarkUrlVisited ( string url ) : void

Remember that the given URL has been visited

This does not cause the control be redrawn

ModelToItem ( object modelObject ) : OLVListItem

Return the OLVListItem that displays the given model object

This method has O(n) performance.

MoveObjects ( int index, ICollection modelObjects ) : void

Move the given collection of objects to the given index.

This operation only makes sense on non-grouped ObjectListViews.

ObjectListView ( ) : System

Create an ObjectListView

ObjectsToHtml ( IList objectsToConvert ) : string

Return a html representation of the given objects

OlvHitTest ( int x, int y ) : OlvListViewHitTestInfo

What is under the given point? This takes the various parts of a cell into accout, including any custom parts that a custom renderer might use

PauseAnimations ( bool isPause ) : void

Pause (or unpause) all animations in the list

PossibleFinishCellEditing ( ) : bool

If a cell edit is in progress, finish the edit.

This method does not guarantee that the editing will finish. The validation process can cause the finishing to be aborted. Developers should check the return value or use IsCellEditing property after calling this method to see if the user is still editing a cell.

PossibleFinishCellEditing ( bool expectingCellEdit ) : bool

If a cell edit is in progress, finish the edit.

This method does not guarantee that the editing will finish. The validation process can cause the finishing to be aborted. Developers should check the return value or use IsCellEditing property after calling this method to see if the user is still editing a cell.

RebuildColumns ( ) : void

Rebuild the columns based upon its current view and column visibility settings

RefreshHotItem ( ) : void

Force the hot item to be recalculated

RefreshItem ( OLVListItem olvi ) : void

Update the ListViewItem with the data from its associated model.

This method does not resort or regroup the view. It simply updates the displayed data of the given item

RefreshObject ( object modelObject ) : void

Update the rows that are showing the given objects

This method does not resort or regroup the view.

RefreshObjects ( IList modelObjects ) : void

Update the rows that are showing the given objects

This method does not resort or regroup the view.

This method can safely be called from background threads.

RefreshOverlay ( IOverlay overlay ) : void

Refresh the display of just one overlays

RefreshOverlays ( ) : void

Refresh the display of the overlays

RefreshSelectedObjects ( ) : void

Update the rows that are selected

This method does not resort or regroup the view.

RemoveDecoration ( IDecoration decoration ) : void

Remove the given decoration from this list

RemoveObject ( object modelObject ) : void

Remove the given model object from the ListView

See RemoveObjects() for more details

This method is thread-safe.

RemoveObjects ( ICollection modelObjects ) : void

Remove all of the given objects from the control.

Nulls and model objects that are not in the ListView are silently ignored.

This method is thread-safe.

RemoveOverlay ( IOverlay overlay ) : void

Remove the given overlay to those on this list

Reset ( ) : void

Make the list forget everything -- all rows and all columns

Use ClearObjects if you want to remove just the rows.

ResetColumnFiltering ( ) : void

Remove all column filtering.

RestoreState ( byte state ) : bool

Restore the state of the control from the given string, which must have been produced by SaveState()

SaveState ( ) : byte[]

Return a byte array that represents the current state of the ObjectListView, such that the state can be restored by RestoreState()

The state of an ObjectListView includes the attributes that the user can modify: current view (i.e. Details, Tile, Large Icon...) sort column and direction column order column widths column visibility

It does not include selection or the scroll position.

SelectAll ( ) : void

Select all rows in the listview

SelectObject ( object modelObject ) : void

Select the row that is displaying the given model object, in addition to any current selection.

Use the SelectedObject property to deselect all other rows

SelectObject ( object modelObject, bool setFocus ) : void

Select the row that is displaying the given model object, in addition to any current selection.

Use the SelectedObject property to deselect all other rows

SelectObjects ( IList modelObjects ) : void

Select the rows that is displaying any of the given model object. All other rows are deselected.

SetNativeBackgroundImage ( Image image, int xOffset, int yOffset ) : void

Set the given image to be background of the ListView so that it appears at the given percentage offsets within the list.

This has the same limitations as described in SetNativeBackgroundWatermark. Make sure those limitations are understood before using the method.

This is very similar to setting the System.Windows.Forms.Control.BackgroundImage property of the standard .NET ListView, except that the standard BackgroundImage does not handle images with transparent areas properly -- it renders transparent areas as black. This method does not have that problem.

Setting this clears any background watermark.

SetNativeBackgroundTiledImage ( Image image ) : void

Set the given image to be the tiled background of the ListView.

This has the same limitations as described in SetNativeBackgroundWatermark and SetNativeBackgroundImage. Make sure those limitations are understood before using the method.

SetNativeBackgroundWatermark ( Image image ) : void

Set the given image to be fixed in the bottom right of the list view. This image will not scroll when the list view scrolls.

This method uses ListView's native ability to display a background image. It has a few limitations:

It doesn't work well with owner drawn mode. In owner drawn mode, each cell draws itself, including its background, which covers the background image. It doesn't look very good when grid lines are enabled, since the grid lines are drawn over the image. It does not work at all on XP. Obviously, it doesn't look good when alternate row background colors are enabled.

If you can live with these limitations, native watermarks are quite neat. They are true backgrounds, not translucent overlays like the OverlayImage uses. They also have the decided advantage over overlays in that they work correctly even in MDI applications.

Setting this clears any background image.

SetObjects ( IEnumerable collection ) : void

Set the collection of objects that will be shown in this list view.

The list is updated immediately

SetObjects ( IEnumerable collection, bool preserveState ) : void

Set the collection of objects that will be shown in this list view.

The list is updated immediately

SetSubItemImage ( int rowIndex, int subItemIndex, OLVListSubItem subItem, bool shouldClearImages ) : void

Set the subitem image natively

SetupSubItemCheckBoxes ( ) : void

Setup this control so it can display check boxes on subitems (or primary checkboxes in virtual mode)

This gives the ListView a small image list, if it doesn't already have one.

ShowOverlays ( ) : void

Make sure that any overlays are visible.

ShowSortIndicator ( ) : void

Put a sort indicator next to the text of the sort column

Sort ( ) : void

Sort the items by the last sort column and order

Sort ( OLVColumn columnToSort ) : void

Sort the items in the list view by the values in the given column and the last sort order

Sort ( OLVColumn columnToSort, SortOrder order ) : void

Sort the items in the list view by the values in the given column and by the given order.

If ShowGroups is true, the rows will be grouped by the given column. If AlwaysGroupsByColumn is not null, the rows will be grouped by that column, and the rows within each group will be sorted by the given column.

Sort ( int columnToSortIndex ) : void

Sort the items in the list view by the values in the given column and the last sort order

Sort ( string columnToSortName ) : void

Sort the items in the list view by the values in the given column and the last sort order

StartCellEdit ( OLVListItem item, int subItemIndex ) : void

Really start an edit operation on a given cell. The parameters are assumed to be sane.

ToggleCheckObject ( object modelObject ) : void

Toggle the checkedness of the given object. A checked object becomes unchecked; an unchecked or indeterminate object becomes checked. If the list has tristate checkboxes, the order is: unchecked -> checked -> indeterminate -> unchecked ...

ToggleSubItemCheckBox ( object rowObject, OLVColumn column ) : void

Toggle the check at the check box of the given cell

UncheckObject ( object modelObject ) : void

Mark the given object as unchecked in the list

UncheckObjects ( IEnumerable modelObjects ) : void

Mark the given objects as unchecked in the list

UncheckSubItem ( object rowObject, OLVColumn column ) : void

Uncheck the check at the given cell

Unfreeze ( ) : void

Unfreeze the listview. If this call is the outermost Unfreeze(), the contents of the listview will be rebuilt.

Freeze()/Unfreeze() calls nest correctly

Unsort ( ) : void

Remove any sorting and revert to the given order of the model objects

UpdateColumnFiltering ( ) : void

Update the filtering of this ObjectListView based on the value filtering defined in each column

Méthodes protégées

Méthode Description
AddItemsToColumnSelectMenu ( ToolStripItemCollection items ) : void

Create the menu items that will allow columns to be choosen and add them to the given collection

ApplyCellStyle ( BrightIdeasSoftware.OLVListItem olvi, int columnIndex, IItemStyle style ) : void

Apply a style to a cell

ApplyExtendedStyles ( ) : void

Apply all required extended styles to our control.

Whenever .NET code sets an extended style, it erases all other extended styles that it doesn't use. So, we have to explicit reapply the styles that we have added.

Normally, we would override CreateParms property and update the ExStyle member, but ListView seems to ignore all ExStyles that it doesn't already know about. Worse, when we set the LVS_EX_HEADERINALLVIEWS value, bad things happen (the control crashes!).

ApplyRowStyle ( BrightIdeasSoftware.OLVListItem olvi, IItemStyle style ) : void

Apply a style to the given row

CalculateCellEditorBoundsOwnerDrawn ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Rectangle r, Size preferredSize ) : Rectangle

Calculate the bounds of the edit control for the given item/column, when the listview is being owner drawn.

CalculateCellEditorBoundsStandard ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Rectangle cellBounds, Size preferredSize ) : Rectangle

Calculate the bounds of the edit control for the given item/column, when the listview is not being owner drawn.

CalculateOwnerDrawnHitTest ( BrightIdeasSoftware.OlvListViewHitTestInfo hti, int x, int y ) : void

Perform a hit test when the control is owner drawn. This hands off responsibility to the renderer.

CalculateStandardHitTest ( BrightIdeasSoftware.OlvListViewHitTestInfo hti, int x, int y ) : void

Perform a hit test when the control is not owner drawn

CellEditor_Validating ( object sender, CancelEventArgs e ) : void

Called when the cell editor could be about to lose focus. Time to commit the change

CleanupCellEdit ( bool expectingCellEdit ) : void

Remove all trace of any existing cell edit operation

ClearPersistentCheckState ( ) : void

Forget any persistent checkbox state

CollectGroupingParameters ( OLVColumn groupByColumn, SortOrder groupByOrder, OLVColumn column, SortOrder order, OLVColumn secondaryColumn, SortOrder secondaryOrder ) : BrightIdeasSoftware.GroupingParameters

Collect and return all the variables that influence the creation of groups

ConfigureControl ( ) : void

Setup the given control to be a cell editor

CorrectSubItemColors ( ListViewItem olvi ) : void

For some reason, UseItemStyleForSubItems doesn't work for the colors when owner drawing the list, so we have to specifically give each subitem the desired colors

Cells drawn via BaseRenderer don't need this, but it is needed when an owner drawn cell uses DrawDefault=true

CreateCellToolTip ( ) : void

Create a ToolTipControl to manage the tooltip control used by the listview control

CreateGroups ( IEnumerable groups ) : void

Do the actual work of creating the given list of groups

Dispose ( bool disposing ) : void

Dispose of any resources this instance has been using

DoUnfreeze ( ) : void

Do the actual work required when the listview is unfrozen

DrawAllDecorations ( Graphics g, List drawnItems ) : void

Draw all the decorations

FillInValues ( OLVListItem lvi, object rowObject ) : void

Fill in the given OLVListItem with values of the given row

FilterObjects ( IEnumerable originalObjects, IModelFilter aModelFilter, IListFilter aListFilter ) : IEnumerable

Do the actual work of filtering

FindMatchInRange ( string text, int first, int last, OLVColumn column ) : int

Find the first row in the given range of rows that prefix matches the string value of the given column.

ForceSubItemImagesExStyle ( ) : void

Make sure the ListView has the extended style that says to display subitem images.

This method must be called after any .NET call that update the extended styles since they seem to erase this setting.

GetActualImageIndex ( Object imageSelector ) : int

Convert the given image selector to an index into our image list. Return -1 if that's not possible

GetCellEditor ( OLVListItem item, int subItemIndex ) : Control

Return a control that can be used to edit the value of the given cell.

GetCheckState ( Object modelObject ) : CheckState?

Get the checkedness of an object from the model. Returning null means the model does not know and the value from the control will be used.

GetControlValue ( Control control ) : Object

Return the value that the given control is showing

GetPersistentCheckState ( object model ) : CheckState

Gets the checkedness of the given model.

HandleApplicationIdle ( object sender, EventArgs e ) : void

The application is idle. Trigger a SelectionChanged event.

HandleApplicationIdleResizeColumns ( object sender, EventArgs e ) : void

The application is idle. Trigger a SelectionChanged event.

HandleBeginScroll ( Message &m ) : bool

Handle the BeginScroll listview notification

HandleCellToolTipShowing ( object sender, ToolTipShowingEventArgs e ) : void

The cell tooltip control wants information about the tool tip that it should show.

HandleChar ( Message &m ) : bool

Handle the search for item m if possible.

HandleColumnClick ( object sender, ColumnClickEventArgs e ) : void

Event handler for the column click event

HandleColumnWidthChanged ( object sender, ColumnWidthChangedEventArgs e ) : void

When the column widths change, resize the space filling columns

HandleColumnWidthChanging ( object sender, ColumnWidthChangingEventArgs e ) : void

When the column widths are changing, resize the space filling columns

HandleContextMenu ( Message &m ) : bool

The user wants to see the context menu.

We want to ignore context menu requests that are triggered by right clicks on the header

HandleCustomDraw ( Message &m ) : bool

Handle the Custom draw series of notifications

HandleDestroy ( Message &m ) : bool

Handle the underlying control being destroyed

HandleEndScroll ( Message &m ) : bool

Handle the EndScroll listview notification

HandleFindItem ( Message &m ) : bool

Handle the search for item m if possible.

HandleGroupInfo ( Message &m ) : bool

Handle the Group Info series of notifications

HandleHeaderRightClick ( int columnIndex ) : bool

The user has right clicked on the column headers. Do whatever is required

HandleHeaderToolTipShowing ( object sender, ToolTipShowingEventArgs e ) : void

The header tooltip control wants information about the tool tip that it should show.

HandleKeyDown ( Message &m ) : bool

Handle a key down message

HandleLButtonDoubleClick ( Message &m ) : bool

Catch the Left Button double click event.

HandleLButtonDown ( Message &m ) : bool

Catch the Left Button down event.

HandleLButtonUp ( Message &m ) : bool

Catch the Left Button up event.

HandleLayout ( object sender, LayoutEventArgs e ) : void

When the size of the control changes, we have to resize our space filling columns.

HandleLinkClick ( Message &m ) : bool

Handle the LinkClick listview notification

HandleMouseMove ( Message &m ) : bool

Catch the MouseMove event.

HandleNotify ( Message &m ) : bool

In the notification messages, we handle attempts to change the width of our columns

HandlePaint ( Message &m ) : bool

Handle the WM_PAINT event

HandlePostPaint ( ) : void

Perform any steps needed after painting the control

HandlePrePaint ( ) : void

Perform any steps needed before painting the control

HandleRButtonDoubleClick ( Message &m ) : bool

Catch the right Button double click event.

HandleRButtonDown ( Message &m ) : bool

Catch the Right Button down event.

HandleReflectNotify ( Message &m ) : bool

Handle notifications that have been reflected back from the parent window

HandleWindowPosChanging ( Message &m ) : bool

Handle the window position changing.

InitializeCheckBoxImages ( ) : void

Make sure the small image list for this control has checkbox images (used for sub-item checkboxes).

This gives the ListView a small image list, if it doesn't already have one.

InitializeEmptyListMsgOverlay ( ) : void

Create and configure the empty list msg overlay

InitializeStandardOverlays ( ) : void

Initialize the standard image and text overlays

InitializeStateImageList ( ) : void

Initialize the state image list with the required checkbox images

LowLevelHitTest ( int x, int y ) : OlvListViewHitTestInfo

Perform a hit test using the Windows control's SUBITEMHITTEST message. This provides information about group hits that the standard ListView.HitTest() does not.

MakeDefaultCellEditor ( OLVColumn column ) : Control

Return a TextBox that can be used as a default cell editor.

MakeGroups ( GroupingParameters parms ) : IList

Make a list of groups that should be shown according to the given parameters

This should not change the state of the control. It is possible that the groups created will not be used. They may simply be discarded.

MakeHeaderRightClickMenu ( int columnIndex ) : ToolStripDropDown

Create the menu that should be displayed when the user right clicks on the given column header.

MakeSortIndicatorImages ( ) : void

If the sort indicator images don't already exist, this method will make and install them

OnColumnReordered ( ColumnReorderedEventArgs e ) : void

Override the OnColumnReordered method to do what we want

OnControlCreated ( ) : void

This method is called after the control has been fully created.

OnDragDrop ( DragEventArgs args ) : void

OnDragEnter ( DragEventArgs args ) : void

OnDragLeave ( EventArgs e ) : void

OnDragOver ( DragEventArgs args ) : void

OnDrawColumnHeader ( DrawListViewColumnHeaderEventArgs e ) : void

Owner draw the column header

OnDrawItem ( DrawListViewItemEventArgs e ) : void

Owner draw the item

OnDrawSubItem ( DrawListViewSubItemEventArgs e ) : void

Owner draw a single subitem

OnGiveFeedback ( GiveFeedbackEventArgs args ) : void

OnHandleCreated ( EventArgs e ) : void

Called when the handle of the underlying control is created

OnItemDrag ( ItemDragEventArgs e ) : void

OnMouseDown ( MouseEventArgs e ) : void

We need the click count in the mouse up event, but that is always 1. So we have to remember the click count from the preceding mouse down event.

OnMouseLeave ( EventArgs e ) : void

When the mouse leaves the control, remove any hot item highlighting

OnMouseMove ( MouseEventArgs e ) : void

When the mouse moves, we might need to change the hot item.

OnMouseUp ( MouseEventArgs e ) : void

Check to see if we need to start editing a cell

OnQueryContinueDrag ( QueryContinueDragEventArgs args ) : void

OnRightMouseUp ( MouseEventArgs e ) : void

The user right clicked on the control

OnSelectedIndexChanged ( EventArgs e ) : void

This method is called every time a row is selected or deselected. This can be a pain if the user shift-clicks 100 rows. We override this method so we can trigger one event for any number of select/deselects that come from one user action

PostProcessOneRow ( int rowIndex, int displayIndex, OLVListItem olvi ) : void

Do the work required after one item in a listview have been created

PostProcessRows ( ) : void

Do the work required after the items in a listview have been created

ProcessDialogKey ( Keys keyData ) : bool

Handle a key press on this control. We specifically look for F2 which edits the primary column, or a Tab character during an edit operation, which tries to start editing on the next (or previous) cell.

ProcessHyperlinkClicked ( CellClickEventArgs e ) : void

Tell the world that a hyperlink was clicked and if the event isn't handled, do the default processing.

ProcessLButtonDoubleClick ( OlvListViewHitTestInfo hti ) : bool

Handle a mouse double click at the given hit test location

Subclasses can override this to do something unique

ProcessLButtonDown ( OlvListViewHitTestInfo hti ) : bool

Handle a left mouse down at the given hit test location

Subclasses can override this to do something unique

ProcessRButtonDoubleClick ( OlvListViewHitTestInfo hti ) : bool

Handle a right mouse double click at the given hit test location

Subclasses can override this to do something unique

ProcessRButtonDown ( OlvListViewHitTestInfo hti ) : bool

Handle a left mouse down at the given hit test location

Subclasses can override this to do something unique

PutCheckState ( Object modelObject, CheckState state ) : CheckState

Record the change of checkstate for the given object in the model. This does not update the UI -- only the model

ResizeFreeSpaceFillingColumns ( ) : void

Resize our space filling columns so they fill any unoccupied width in the control

ResizeFreeSpaceFillingColumns ( int freeSpace ) : void

Resize our space filling columns so they fill any unoccupied width in the control

SetControlValue ( Control control, Object value, String stringValue ) : void

Try to give the given value to the provided control. Fall back to assigning a string if the value assignment fails.

SetObjectCheckedness ( object modelObject, CheckState state ) : void

Change the check state of the given object to be the given state.

If the given model object isn't in the list, we still try to remember its state, in case it is referenced in the future.

SetPersistentCheckState ( object model, CheckState state ) : CheckState

Remember the check state of the given model object

SetSubItemImages ( int rowIndex, OLVListItem item ) : void

Tell the underlying list control which images to show against the subitems

SetSubItemImages ( int rowIndex, OLVListItem item, bool shouldClearImages ) : void

Tell the underlying list control which images to show against the subitems

ShouldStartCellEdit ( MouseEventArgs e ) : bool

Should we start editing the cell in response to the given mouse button event?

ShowHeaderRightClickMenu ( int columnIndex, Point pt ) : bool

Show a menu that is appropriate when the given column header is clicked.

ShowSortIndicator ( OLVColumn columnToSort, SortOrder sortOrder ) : void

Put a sort indicator next to the text of the given given column

StandardHyperlinkClickedProcessing ( HyperlinkClickedEventArgs args ) : void

Do the default processing for a hyperlink clicked event, which is to try and open the url.

TakeOwnershipOfObjects ( ) : void

Take ownership of the 'objects' collection. This separats our collection from the source.

This method separates the 'objects' instance variable from its source, so that any AddObject/RemoveObject calls will modify our collection and not the original colleciton.

This method has the intentional side-effect of converting our list of objects to an ArrayList.

TriggerFormatRowEvent ( int rowIndex, int displayIndex, OLVListItem olvi ) : void

Trigger FormatRow and possibly FormatCell events for the given item

TriggerGroupExpandCollapse ( OLVGroup group ) : bool

Trigger a GroupExpandCollapse event and return true if the action was cancelled

UnapplyHotItem ( int index ) : void

Remove hot item styling from the given row

UpdateCellToolTipHandle ( ) : void

Update the handle used by our cell tooltip to be the tooltip used by the underlying Windows listview control.

UpdateFiltering ( ) : void

When some setting related to filtering changes, this method is called.

UpdateHotItem ( OlvListViewHitTestInfo hti ) : void

The mouse has moved to the given pt. See if the hot item needs to be updated

This is the main entry point for hot item handling

UpdateHotItem ( Point pt ) : void

The mouse has moved to the given pt. See if the hot item needs to be updated

This is the main entry point for hot item handling

UpdateHotRow ( OLVListItem olvi ) : void

Update the given row using the current hot item information

UpdateHotRow ( int rowIndex, int columnIndex, HitTestLocation hitLocation, OLVListItem olvi ) : void

Update the given row using the given hot item information

UpdateNotificationSubscriptions ( IEnumerable collection ) : void

Change any subscriptions to INotifyPropertyChanged events on our current model objects so that we no longer listen for events on the old models and do listen for events on the given collection.

This does nothing if UseNotifyPropertyChanged is false.

WndProc ( Message &m ) : void

Override the basic message pump for this control

Private Methods

Méthode Description
AddCheckStateBitmap ( ImageList il, string key, CheckBoxState boxState ) : void
ApplyHyperlinkStyle ( int rowIndex, BrightIdeasSoftware.OLVListItem olvi ) : void
BuildBeforeSortingEventArgs ( OLVColumn column, SortOrder order ) : BrightIdeasSoftware.BeforeSortingEventArgs
BuildCellEvent ( BrightIdeasSoftware.CellEventArgs args, Point location ) : void
CalculateCellBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, ItemBoundsPortion portion ) : Rectangle
CalculateCheckState ( int state ) : CheckState
CalculateToggledCheckState ( OLVColumn column, CheckState currentState ) : CheckState
ColumnSelectMenuClosing ( object sender, System.Windows.Forms.ToolStripDropDownClosingEventArgs e ) : void
ColumnSelectMenuItemClicked ( object sender, ToolStripItemClickedEventArgs e ) : void
DoSort ( OLVColumn columnToSort, SortOrder order ) : void
FindGlassPanelForOverlay ( IOverlay overlay ) : GlassPanelForm
GetCheckedObject ( ) : object
GetCheckedObjects ( ) : ArrayList
GetFirstNonNullValue ( OLVColumn column ) : object

Get the first non-null value of the given column. At most 1000 rows will be considered.

GetSelectedObject ( ) : object
GetSelectedObjects ( ) : ArrayList
HandleHeaderRightClick ( ) : bool
HandleModelOnPropertyChanged ( object sender, PropertyChangedEventArgs propertyChangedEventArgs ) : void
HeaderToolTipShowingCallback ( object sender, ToolTipShowingEventArgs e ) : void

Allow the HeaderControl to call back into HandleHeaderToolTipShowing without making that method public

LowLevelScroll ( int dx, int dy ) : void

Scroll the ListView by the given deltas.

MakeResizedImage ( int width, int height, Image image, Color transparent ) : Bitmap

Return a bitmap of the given height x height, which shows the given image, centred.

MakeResizedImageList ( int width, int height, ImageList source ) : ImageList

Return a copy of the given source image list, where each image has been resized to be height x height in size. If source is null, an empty image list of the given size is returned

MakeSubItem ( object rowObject, OLVColumn column ) : OLVListSubItem
MakeTriangleBitmap ( Size sz, Point pts ) : Bitmap
PrepareAlternateBackColors ( ) : void
RememberDisplayIndicies ( ) : void
RunWhenIdle ( EventHandler eventHandler ) : void
SetAllSubItemImages ( ) : void
SetGroupSpacing ( ) : void
SetupBaseImageList ( ) : void

Update our externally visible image list so it holds the same images as our shadow list, but sized correctly

ShouldShowOverlays ( ) : bool
ShowColumnCommandMenu ( int columnIndex, Point pt ) : void
ShowColumnSelectMenu ( Point pt ) : void
StateToString ( uint state ) : string
SubscribeNotifications ( IEnumerable models ) : void
ToggleSelectedRowCheckBoxes ( ) : void
UnsubscribeNotifications ( IEnumerable models ) : void

Method Details

AddDecoration() public méthode

Add the given decoration to those on this list and make it appear
A decoration scrolls with the listview. An overlay stays fixed in place.
public AddDecoration ( IDecoration decoration ) : void
decoration IDecoration The decoration
Résultat void

AddItemsToColumnSelectMenu() protected méthode

Create the menu items that will allow columns to be choosen and add them to the given collection
protected AddItemsToColumnSelectMenu ( ToolStripItemCollection items ) : void
items System.Windows.Forms.ToolStripItemCollection
Résultat void

AddObject() public méthode

Add the given model object to this control.
See AddObjects() for more details
public AddObject ( object modelObject ) : void
modelObject object The model object to be displayed
Résultat void

AddObjects() public méthode

Add the given collection of model objects to this control.

The added objects will appear in their correct sort position, if sorting is active (i.e. if LastSortColumn is not null). Otherwise, they will appear at the end of the list.

No check is performed to see if any of the objects are already in the ListView.

Null objects are silently ignored.

public AddObjects ( ICollection modelObjects ) : void
modelObjects ICollection A collection of model objects
Résultat void

AddOverlay() public méthode

Add the given overlay to those on this list and make it appear
public AddOverlay ( IOverlay overlay ) : void
overlay IOverlay The overlay
Résultat void

ApplyCellStyle() protected méthode

Apply a style to a cell
protected ApplyCellStyle ( BrightIdeasSoftware.OLVListItem olvi, int columnIndex, IItemStyle style ) : void
olvi BrightIdeasSoftware.OLVListItem
columnIndex int
style IItemStyle
Résultat void

ApplyExtendedStyles() protected méthode

Apply all required extended styles to our control.

Whenever .NET code sets an extended style, it erases all other extended styles that it doesn't use. So, we have to explicit reapply the styles that we have added.

Normally, we would override CreateParms property and update the ExStyle member, but ListView seems to ignore all ExStyles that it doesn't already know about. Worse, when we set the LVS_EX_HEADERINALLVIEWS value, bad things happen (the control crashes!).

protected ApplyExtendedStyles ( ) : void
Résultat void

ApplyRowStyle() protected méthode

Apply a style to the given row
protected ApplyRowStyle ( BrightIdeasSoftware.OLVListItem olvi, IItemStyle style ) : void
olvi BrightIdeasSoftware.OLVListItem
style IItemStyle
Résultat void

AutoResizeColumns() public méthode

Resize the columns to the maximum of the header width and the data.
public AutoResizeColumns ( ) : void
Résultat void

BuildGroups() public méthode

Organise the view items into groups, based on the last sort column or the first column if there is no last sort column
public BuildGroups ( ) : void
Résultat void

BuildGroups() public méthode

Organise the view items into groups, based on the given column

If the AlwaysGroupByColumn property is not null, the list view items will be organisd by that column, and the 'column' parameter will be ignored.

This method triggers sorting events: BeforeSorting and AfterSorting.

public BuildGroups ( OLVColumn column, SortOrder order ) : void
column OLVColumn The column whose values should be used for sorting.
order SortOrder
Résultat void

BuildGroups() public méthode

Organise the view items into groups, based on the given columns
This method does not trigger sorting events. Use BuildGroups() to do that
public BuildGroups ( OLVColumn groupByColumn, SortOrder groupByOrder, OLVColumn column, SortOrder order, OLVColumn secondaryColumn, SortOrder secondaryOrder ) : void
groupByColumn OLVColumn What column will be used for grouping
groupByOrder SortOrder What ordering will be used for groups
column OLVColumn The column whose values should be used for sorting. Cannot be null
order SortOrder The order in which the values from column will be sorted
secondaryColumn OLVColumn When the values from 'column' are equal, use the values provided by this column
secondaryOrder SortOrder How will the secondary values be sorted
Résultat void

BuildList() public méthode

Build/rebuild all the list view items in the list, preserving as much state as is possible
public BuildList ( ) : void
Résultat void

BuildList() public méthode

Build/rebuild all the list view items in the list

Use this method in situations were the contents of the list is basically the same as previously.

public BuildList ( bool shouldPreserveState ) : void
shouldPreserveState bool If this is true, the control will try to preserve the selection, /// focused item, and the scroll position (see Remarks) ///
Résultat void

CalculateCellBounds() public méthode

Return the bounds of the given cell
public CalculateCellBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex ) : Rectangle
item BrightIdeasSoftware.OLVListItem The row to be edited
subItemIndex int The index of the cell to be edited
Résultat System.Drawing.Rectangle

CalculateCellEditorBounds() public méthode

Calculate the bounds of the edit control for the given item/column
public CalculateCellEditorBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Size preferredSize ) : Rectangle
item BrightIdeasSoftware.OLVListItem
subItemIndex int
preferredSize System.Drawing.Size
Résultat System.Drawing.Rectangle

CalculateCellEditorBoundsOwnerDrawn() protected méthode

Calculate the bounds of the edit control for the given item/column, when the listview is being owner drawn.
protected CalculateCellEditorBoundsOwnerDrawn ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Rectangle r, Size preferredSize ) : Rectangle
item BrightIdeasSoftware.OLVListItem
subItemIndex int
r System.Drawing.Rectangle
preferredSize System.Drawing.Size
Résultat System.Drawing.Rectangle

CalculateCellEditorBoundsStandard() protected méthode

Calculate the bounds of the edit control for the given item/column, when the listview is not being owner drawn.
protected CalculateCellEditorBoundsStandard ( BrightIdeasSoftware.OLVListItem item, int subItemIndex, Rectangle cellBounds, Size preferredSize ) : Rectangle
item BrightIdeasSoftware.OLVListItem
subItemIndex int
cellBounds System.Drawing.Rectangle
preferredSize System.Drawing.Size
Résultat System.Drawing.Rectangle

CalculateCellTextBounds() public méthode

Return the bounds of the given cell only until the edge of the current text
public CalculateCellTextBounds ( BrightIdeasSoftware.OLVListItem item, int subItemIndex ) : Rectangle
item BrightIdeasSoftware.OLVListItem The row to be edited
subItemIndex int The index of the cell to be edited
Résultat System.Drawing.Rectangle

CalculateOwnerDrawnHitTest() protected méthode

Perform a hit test when the control is owner drawn. This hands off responsibility to the renderer.
protected CalculateOwnerDrawnHitTest ( BrightIdeasSoftware.OlvListViewHitTestInfo hti, int x, int y ) : void
hti BrightIdeasSoftware.OlvListViewHitTestInfo
x int
y int
Résultat void

CalculateReasonableTileSize() public méthode

Give the listview a reasonable size of its tiles, based on the number of lines of information that each tile is going to display.
public CalculateReasonableTileSize ( ) : void
Résultat void

CalculateStandardHitTest() protected méthode

Perform a hit test when the control is not owner drawn
protected CalculateStandardHitTest ( BrightIdeasSoftware.OlvListViewHitTestInfo hti, int x, int y ) : void
hti BrightIdeasSoftware.OlvListViewHitTestInfo
x int
y int
Résultat void

CancelCellEdit() public méthode

Stop editing a cell and throw away any changes.
public CancelCellEdit ( ) : void
Résultat void

CellEditor_Validating() protected méthode

Called when the cell editor could be about to lose focus. Time to commit the change
protected CellEditor_Validating ( object sender, CancelEventArgs e ) : void
sender object
e CancelEventArgs
Résultat void

ChangeToFilteredColumns() public méthode

Rebuild this list for the given view
public ChangeToFilteredColumns ( View view ) : void
view View
Résultat void

CheckIndeterminateObject() public méthode

Mark the given object as indeterminate check state
public CheckIndeterminateObject ( object modelObject ) : void
modelObject object The model object to be marked indeterminate
Résultat void

CheckIndeterminateSubItem() public méthode

Put an indeterminate check into the check box at the given cell
public CheckIndeterminateSubItem ( object rowObject, OLVColumn column ) : void
rowObject object
column OLVColumn
Résultat void

CheckObject() public méthode

Mark the given object as checked in the list
public CheckObject ( object modelObject ) : void
modelObject object The model object to be checked
Résultat void

CheckObjects() public méthode

Mark the given objects as checked in the list
public CheckObjects ( IEnumerable modelObjects ) : void
modelObjects IEnumerable The model object to be checked
Résultat void

CheckSubItem() public méthode

Put a check into the check box at the given cell
public CheckSubItem ( object rowObject, OLVColumn column ) : void
rowObject object
column OLVColumn
Résultat void

CleanupCellEdit() protected méthode

Remove all trace of any existing cell edit operation
protected CleanupCellEdit ( bool expectingCellEdit ) : void
expectingCellEdit bool
Résultat void

ClearHotItem() public méthode

Force the hot item to be recalculated
public ClearHotItem ( ) : void
Résultat void

ClearObjects() public méthode

Remove all items from this list
public ClearObjects ( ) : void
Résultat void

ClearPersistentCheckState() protected méthode

Forget any persistent checkbox state
protected ClearPersistentCheckState ( ) : void
Résultat void

ClearUrlVisited() public méthode

Reset the memory of which URLs have been visited
public ClearUrlVisited ( ) : void
Résultat void

CollectGroupingParameters() protected méthode

Collect and return all the variables that influence the creation of groups
protected CollectGroupingParameters ( OLVColumn groupByColumn, SortOrder groupByOrder, OLVColumn column, SortOrder order, OLVColumn secondaryColumn, SortOrder secondaryOrder ) : BrightIdeasSoftware.GroupingParameters
groupByColumn OLVColumn
groupByOrder SortOrder
column OLVColumn
order SortOrder
secondaryColumn OLVColumn
secondaryOrder SortOrder
Résultat BrightIdeasSoftware.GroupingParameters

ConfigureAutoComplete() public méthode

Configure the given text box to autocomplete unique values from the given column. At most 1000 rows will be considered.
public ConfigureAutoComplete ( TextBox tb, OLVColumn column ) : void
tb System.Windows.Forms.TextBox The textbox to configure
column OLVColumn The column used to calculate values
Résultat void

ConfigureAutoComplete() public méthode

Configure the given text box to autocomplete unique values from the given column. At most 1000 rows will be considered.
public ConfigureAutoComplete ( TextBox tb, OLVColumn column, int maxRows ) : void
tb System.Windows.Forms.TextBox The textbox to configure
column OLVColumn The column used to calculate values
maxRows int Consider only this many rows
Résultat void

ConfigureControl() protected méthode

Setup the given control to be a cell editor
protected ConfigureControl ( ) : void
Résultat void

CopyObjectsToClipboard() public méthode

Copy a text and html representation of the given objects onto the clipboard.
public CopyObjectsToClipboard ( IList objectsToCopy ) : void
objectsToCopy IList
Résultat void

CopySelectionToClipboard() public méthode

Copy a text and html representation of the selected rows onto the clipboard.
Be careful when using this with virtual lists. If the user has selected 10,000,000 rows, this method will faithfully try to copy all of them to the clipboard. From the user's point of view, your program will appear to have hung.
public CopySelectionToClipboard ( ) : void
Résultat void

CorrectSubItemColors() protected méthode

For some reason, UseItemStyleForSubItems doesn't work for the colors when owner drawing the list, so we have to specifically give each subitem the desired colors
Cells drawn via BaseRenderer don't need this, but it is needed when an owner drawn cell uses DrawDefault=true
protected CorrectSubItemColors ( ListViewItem olvi ) : void
olvi ListViewItem The item whose subitems are to be corrected
Résultat void

CreateCellToolTip() protected méthode

Create a ToolTipControl to manage the tooltip control used by the listview control
protected CreateCellToolTip ( ) : void
Résultat void

CreateColumnFilter() public méthode

Create a filter that will enact all the filtering currently installed on the visible columns.
public CreateColumnFilter ( ) : IModelFilter
Résultat IModelFilter

CreateGroups() protected méthode

Do the actual work of creating the given list of groups
protected CreateGroups ( IEnumerable groups ) : void
groups IEnumerable
Résultat void

DeselectAll() public méthode

Deselect all rows in the listview
public DeselectAll ( ) : void
Résultat void

Dispose() protected méthode

Dispose of any resources this instance has been using
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

DoUnfreeze() protected méthode

Do the actual work required when the listview is unfrozen
protected DoUnfreeze ( ) : void
Résultat void

DrawAllDecorations() protected méthode

Draw all the decorations
protected DrawAllDecorations ( Graphics g, List drawnItems ) : void
g Graphics A Graphics
drawnItems List The items that were redrawn and whose decorations should also be redrawn
Résultat void

DropSinkCanDrop() public méthode

public DropSinkCanDrop ( object sender, OlvDropEventArgs e ) : void
sender object
e OlvDropEventArgs
Résultat void

DropSinkDropped() public méthode

public DropSinkDropped ( object sender, OlvDropEventArgs e ) : void
sender object
e OlvDropEventArgs
Résultat void

DropSinkModelCanDrop() public méthode

public DropSinkModelCanDrop ( object sender, ModelDropEventArgs e ) : void
sender object
e ModelDropEventArgs
Résultat void

DropSinkModelDropped() public méthode

public DropSinkModelDropped ( object sender, ModelDropEventArgs e ) : void
sender object
e ModelDropEventArgs
Résultat void

EditSubItem() public méthode

Begin an edit operation on the given cell.
This performs various sanity checks and passes off the real work to StartCellEdit().
public EditSubItem ( OLVListItem item, int subItemIndex ) : void
item OLVListItem The row to be edited
subItemIndex int The index of the cell to be edited
Résultat void

EnableCustomSelectionColors() public méthode

Setup the list so it will draw selected rows using custom colours.
This method makes the list owner drawn, and ensures that all columns have at least a BaseRender installed.
public EnableCustomSelectionColors ( ) : void
Résultat void

EnsureGroupVisible() public méthode

Scroll the listview so that the given group is at the top.

If the group is already visible, the list will still be scrolled to move the group to the top, if that is possible.

This only works when the list is showing groups (obviously).

This does not work on virtual lists, since virtual lists don't use ListViewGroups for grouping. Use VirtualObjectListView.EnsureNthGroupVisible instead.

public EnsureGroupVisible ( ListViewGroup lvg ) : void
lvg ListViewGroup The group to be revealed
Résultat void

EnsureModelVisible() public méthode

Ensure that the given model object is visible
public EnsureModelVisible ( Object modelObject ) : void
modelObject Object The model object to be revealed
Résultat void

EnumerableToArray() public static méthode

Convert the given enumerable into an ArrayList as efficiently as possible

When we move to .NET 3.5, we can use LINQ and not need this method.

public static EnumerableToArray ( IEnumerable collection, bool alwaysCreate ) : ArrayList
collection IEnumerable The source collection
alwaysCreate bool If true, this method will always create a new /// collection.
Résultat ArrayList

FillInValues() protected méthode

Fill in the given OLVListItem with values of the given row
protected FillInValues ( OLVListItem lvi, object rowObject ) : void
lvi OLVListItem the OLVListItem that is to be stuff with values
rowObject object the model object from which values will be taken
Résultat void

FilterObjects() protected méthode

Do the actual work of filtering
protected FilterObjects ( IEnumerable originalObjects, IModelFilter aModelFilter, IListFilter aListFilter ) : IEnumerable
originalObjects IEnumerable
aModelFilter IModelFilter
aListFilter IListFilter
Résultat IEnumerable

FindMatchInRange() protected méthode

Find the first row in the given range of rows that prefix matches the string value of the given column.
protected FindMatchInRange ( string text, int first, int last, OLVColumn column ) : int
text string
first int
last int
column OLVColumn
Résultat int

FindMatchingRow() public méthode

Find the first row after the given start in which the text value in the comparison column begins with the given text. The comparison column is column 0, unless IsSearchOnSortColumn is true, in which case the current sort column is used.
The text comparison is a case-insensitive, prefix match. The search will search the every row until a match is found, wrapping at the end if needed.
public FindMatchingRow ( string text, int start, SearchDirectionHint direction ) : int
text string The text to be prefix matched
start int The index of the first row to consider
direction SearchDirectionHint Which direction should be searched?
Résultat int

FinishCellEdit() public méthode

Finish the cell edit operation, writing changed data back to the model object
This method does not trigger a Validating event, so it always finishes the cell edit.
public FinishCellEdit ( ) : void
Résultat void

FinishCellEdit() public méthode

Finish the cell edit operation, writing changed data back to the model object
This method does not trigger a Validating event, so it always finishes the cell edit.
public FinishCellEdit ( bool expectingCellEdit ) : void
expectingCellEdit bool True if it is likely that another cell is going to be /// edited immediately after this cell finishes editing
Résultat void

ForceSubItemImagesExStyle() protected méthode

Make sure the ListView has the extended style that says to display subitem images.
This method must be called after any .NET call that update the extended styles since they seem to erase this setting.
protected ForceSubItemImagesExStyle ( ) : void
Résultat void

Freeze() public méthode

Freeze the listview so that it no longer updates itself.
Freeze()/Unfreeze() calls nest correctly
public Freeze ( ) : void
Résultat void

GetActualImageIndex() protected méthode

Convert the given image selector to an index into our image list. Return -1 if that's not possible
protected GetActualImageIndex ( Object imageSelector ) : int
imageSelector Object
Résultat int

GetCellEditor() protected méthode

Return a control that can be used to edit the value of the given cell.
protected GetCellEditor ( OLVListItem item, int subItemIndex ) : Control
item OLVListItem The row to be edited
subItemIndex int The index of the cell to be edited
Résultat Control

GetCellToolTip() public méthode

Return the tooltip that should be shown when the mouse is hovered over the given cell
public GetCellToolTip ( int columnIndex, int rowIndex ) : String
columnIndex int The column index whose tool tip is to be fetched
rowIndex int The row index whose tool tip is to be fetched
Résultat String

GetCheckState() protected méthode

Get the checkedness of an object from the model. Returning null means the model does not know and the value from the control will be used.
protected GetCheckState ( Object modelObject ) : CheckState?
modelObject Object
Résultat CheckState?

GetColumn() public méthode

Return the column at the given index
public GetColumn ( int index ) : OLVColumn
index int Index of the column to be returned
Résultat OLVColumn

GetColumn() public méthode

Return the column at the given title.
public GetColumn ( string name ) : OLVColumn
name string Name of the column to be returned
Résultat OLVColumn

GetControlValue() protected méthode

Return the value that the given control is showing
protected GetControlValue ( Control control ) : Object
control Control
Résultat Object

GetDisplayOrderOfItemIndex() public méthode

Return the display index of the given listviewitem index. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.
public GetDisplayOrderOfItemIndex ( int itemIndex ) : int
itemIndex int
Résultat int

GetFilteredColumns() public méthode

Return a collection of columns that are visible to the given view. Only Tile and Details have columns; all other views have 0 columns.
public GetFilteredColumns ( View view ) : List
view View Which view are the columns being calculate for?
Résultat List

GetHeaderToolTip() public méthode

Return the tooltip that should be shown when the mouse is hovered over the given column
public GetHeaderToolTip ( int columnIndex ) : String
columnIndex int The column index whose tool tip is to be fetched
Résultat String

GetItem() public méthode

Return the item at the given index
public GetItem ( int index ) : OLVListItem
index int Index of the item to be returned
Résultat OLVListItem

GetItemAt() public méthode

Find the item and column that are under the given co-ords
public GetItemAt ( int x, int y, OLVColumn &hitColumn ) : OLVListItem
x int X co-ord
y int Y co-ord
hitColumn OLVColumn The column under the given point
Résultat OLVListItem

GetItemCount() public méthode

Return the number of items in the list
public GetItemCount ( ) : int
Résultat int

GetLastItemInDisplayOrder() public méthode

Return the last item in the order they are shown to the user. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.
public GetLastItemInDisplayOrder ( ) : OLVListItem
Résultat OLVListItem

GetModelObject() public méthode

Return the model object at the given index
public GetModelObject ( int index ) : object
index int Index of the model object to be returned
Résultat object

GetNextItem() public méthode

Return the ListViewItem that appears immediately after the given item. If the given item is null, the first item in the list will be returned. Return null if the given item is the last item.
public GetNextItem ( OLVListItem itemToFind ) : OLVListItem
itemToFind OLVListItem The item that is before the item that is returned, or null
Résultat OLVListItem

GetNthItemInDisplayOrder() public méthode

Return the n'th item (0-based) in the order they are shown to the user. If the control is not grouped, the display order is the same as the sorted list order. But if the list is grouped, the display order is different.
public GetNthItemInDisplayOrder ( int n ) : OLVListItem
n int
Résultat OLVListItem

GetPersistentCheckState() protected méthode

Gets the checkedness of the given model.
protected GetPersistentCheckState ( object model ) : CheckState
model object The model
Résultat CheckState

GetPreviousItem() public méthode

Return the ListViewItem that appears immediately before the given item. If the given item is null, the last item in the list will be returned. Return null if the given item is the first item.
public GetPreviousItem ( OLVListItem itemToFind ) : OLVListItem
itemToFind OLVListItem The item that is before the item that is returned
Résultat OLVListItem

GetSubItem() public méthode

Return the sub item at the given index/column
public GetSubItem ( int index, int columnIndex ) : OLVListSubItem
index int Index of the item to be returned
columnIndex int Index of the subitem to be returned
Résultat OLVListSubItem

HandleApplicationIdle() protected méthode

The application is idle. Trigger a SelectionChanged event.
protected HandleApplicationIdle ( object sender, EventArgs e ) : void
sender object
e EventArgs
Résultat void

HandleApplicationIdleResizeColumns() protected méthode

The application is idle. Trigger a SelectionChanged event.
protected HandleApplicationIdleResizeColumns ( object sender, EventArgs e ) : void
sender object
e EventArgs
Résultat void

HandleBeginScroll() protected méthode

Handle the BeginScroll listview notification
protected HandleBeginScroll ( Message &m ) : bool
m Message
Résultat bool

HandleCellToolTipShowing() protected méthode

The cell tooltip control wants information about the tool tip that it should show.
protected HandleCellToolTipShowing ( object sender, ToolTipShowingEventArgs e ) : void
sender object
e ToolTipShowingEventArgs
Résultat void

HandleChar() protected méthode

Handle the search for item m if possible.
protected HandleChar ( Message &m ) : bool
m Message The m to be processed
Résultat bool

HandleColumnClick() protected méthode

Event handler for the column click event
protected HandleColumnClick ( object sender, ColumnClickEventArgs e ) : void
sender object
e ColumnClickEventArgs
Résultat void

HandleColumnWidthChanged() protected méthode

When the column widths change, resize the space filling columns
protected HandleColumnWidthChanged ( object sender, ColumnWidthChangedEventArgs e ) : void
sender object
e ColumnWidthChangedEventArgs
Résultat void

HandleColumnWidthChanging() protected méthode

When the column widths are changing, resize the space filling columns
protected HandleColumnWidthChanging ( object sender, ColumnWidthChangingEventArgs e ) : void
sender object
e ColumnWidthChangingEventArgs
Résultat void

HandleContextMenu() protected méthode

The user wants to see the context menu.
We want to ignore context menu requests that are triggered by right clicks on the header
protected HandleContextMenu ( Message &m ) : bool
m Message The windows m
Résultat bool

HandleCustomDraw() protected méthode

Handle the Custom draw series of notifications
protected HandleCustomDraw ( Message &m ) : bool
m Message The message
Résultat bool

HandleDestroy() protected méthode

Handle the underlying control being destroyed
protected HandleDestroy ( Message &m ) : bool
m Message
Résultat bool

HandleEndScroll() protected méthode

Handle the EndScroll listview notification
protected HandleEndScroll ( Message &m ) : bool
m Message
Résultat bool

HandleFindItem() protected méthode

Handle the search for item m if possible.
protected HandleFindItem ( Message &m ) : bool
m Message The m to be processed
Résultat bool

HandleGroupInfo() protected méthode

Handle the Group Info series of notifications
protected HandleGroupInfo ( Message &m ) : bool
m Message The message
Résultat bool

HandleHeaderRightClick() protected méthode

The user has right clicked on the column headers. Do whatever is required
protected HandleHeaderRightClick ( int columnIndex ) : bool
columnIndex int
Résultat bool

HandleHeaderToolTipShowing() protected méthode

The header tooltip control wants information about the tool tip that it should show.
protected HandleHeaderToolTipShowing ( object sender, ToolTipShowingEventArgs e ) : void
sender object
e ToolTipShowingEventArgs
Résultat void

HandleKeyDown() protected méthode

Handle a key down message
protected HandleKeyDown ( Message &m ) : bool
m Message
Résultat bool

HandleLButtonDoubleClick() protected méthode

Catch the Left Button double click event.
protected HandleLButtonDoubleClick ( Message &m ) : bool
m Message The m to be processed
Résultat bool

HandleLButtonDown() protected méthode

Catch the Left Button down event.
protected HandleLButtonDown ( Message &m ) : bool
m Message The m to be processed
Résultat bool

HandleLButtonUp() protected méthode

Catch the Left Button up event.
protected HandleLButtonUp ( Message &m ) : bool
m Message The m to be processed
Résultat bool

HandleLayout() protected méthode

When the size of the control changes, we have to resize our space filling columns.
protected HandleLayout ( object sender, LayoutEventArgs e ) : void
sender object
e LayoutEventArgs
Résultat void

HandleLinkClick() protected méthode

Handle the LinkClick listview notification
protected HandleLinkClick ( Message &m ) : bool
m Message
Résultat bool

HandleMouseMove() protected méthode

Catch the MouseMove event.
protected HandleMouseMove ( Message &m ) : bool
m Message The m to be processed
Résultat bool

HandleNotify() protected méthode

In the notification messages, we handle attempts to change the width of our columns
protected HandleNotify ( Message &m ) : bool
m Message The m to be processed
Résultat bool

HandlePaint() protected méthode

Handle the WM_PAINT event
protected HandlePaint ( Message &m ) : bool
m Message
Résultat bool

HandlePostPaint() protected méthode

Perform any steps needed after painting the control
protected HandlePostPaint ( ) : void
Résultat void

HandlePrePaint() protected méthode

Perform any steps needed before painting the control
protected HandlePrePaint ( ) : void
Résultat void

HandleRButtonDoubleClick() protected méthode

Catch the right Button double click event.
protected HandleRButtonDoubleClick ( Message &m ) : bool
m Message The m to be processed
Résultat bool

HandleRButtonDown() protected méthode

Catch the Right Button down event.
protected HandleRButtonDown ( Message &m ) : bool
m Message The m to be processed
Résultat bool

HandleReflectNotify() protected méthode

Handle notifications that have been reflected back from the parent window
protected HandleReflectNotify ( Message &m ) : bool
m Message The m to be processed
Résultat bool

HandleWindowPosChanging() protected méthode

Handle the window position changing.
protected HandleWindowPosChanging ( Message &m ) : bool
m Message The m to be processed
Résultat bool

HasDecoration() public méthode

Is the given decoration shown on this list
public HasDecoration ( IDecoration decoration ) : bool
decoration IDecoration The overlay
Résultat bool

HasOverlay() public méthode

Is the given overlay shown on this list?
public HasOverlay ( IOverlay overlay ) : bool
overlay IOverlay The overlay
Résultat bool

HideOverlays() public méthode

Hide any overlays.
This is only a temporary hiding -- the overlays will be shown the next time the ObjectListView redraws.
public HideOverlays ( ) : void
Résultat void

HitTest() public méthode

Calculate what item is under the given point?
public HitTest ( int x, int y ) : ListViewHitTestInfo
x int
y int
Résultat ListViewHitTestInfo

ISupportInitialize() public méthode

public ISupportInitialize ( ) : void
Résultat void

IndexOf() public méthode

Find the given model object within the listview and return its index
public IndexOf ( Object modelObject ) : int
modelObject Object The model object to be found
Résultat int

InitializeCheckBoxImages() protected méthode

Make sure the small image list for this control has checkbox images (used for sub-item checkboxes).
This gives the ListView a small image list, if it doesn't already have one.
protected InitializeCheckBoxImages ( ) : void
Résultat void

InitializeEmptyListMsgOverlay() protected méthode

Create and configure the empty list msg overlay
protected InitializeEmptyListMsgOverlay ( ) : void
Résultat void

InitializeStandardOverlays() protected méthode

Initialize the standard image and text overlays
protected InitializeStandardOverlays ( ) : void
Résultat void

InitializeStateImageList() protected méthode

Initialize the state image list with the required checkbox images
protected InitializeStateImageList ( ) : void
Résultat void

InsertObjects() public méthode

Insert the given collection of objects before the given position

This operation only makes sense of non-sorted, non-grouped lists, since any subsequent sort/group operation will rearrange the list.

This method only works on ObjectListViews and FastObjectListViews.

public InsertObjects ( int index, ICollection modelObjects ) : void
index int Where to insert the objects
modelObjects ICollection The objects to be inserted
Résultat void

IsChecked() public méthode

Return true of the given object is checked
If the given object is not in the list, this method returns false.
public IsChecked ( object modelObject ) : bool
modelObject object The model object whose checkedness is returned
Résultat bool

IsCheckedIndeterminate() public méthode

Return true of the given object is indeterminately checked
If the given object is not in the list, this method returns false.
public IsCheckedIndeterminate ( object modelObject ) : bool
modelObject object The model object whose checkedness is returned
Résultat bool

IsEnumerableEmpty() public static méthode

public static IsEnumerableEmpty ( IEnumerable collection ) : bool
collection IEnumerable
Résultat bool

IsSelected() public méthode

Return true if the row representing the given model is selected
public IsSelected ( object model ) : bool
model object The model object to look for
Résultat bool

IsSubItemChecked() public méthode

Is there a check at the check box at the given cell
public IsSubItemChecked ( object rowObject, OLVColumn column ) : bool
rowObject object
column OLVColumn
Résultat bool

IsUrlVisited() public méthode

Has the given URL been visited?
public IsUrlVisited ( string url ) : bool
url string The string to be consider
Résultat bool

LowLevelHitTest() protected méthode

Perform a hit test using the Windows control's SUBITEMHITTEST message. This provides information about group hits that the standard ListView.HitTest() does not.
protected LowLevelHitTest ( int x, int y ) : OlvListViewHitTestInfo
x int
y int
Résultat OlvListViewHitTestInfo

MakeColumnCommandMenu() public méthode

Append the column selection menu items to the given menu strip.
public MakeColumnCommandMenu ( ToolStripDropDown strip, int columnIndex ) : ToolStripDropDown
strip ToolStripDropDown The menu to which the items will be added.
columnIndex int
Résultat ToolStripDropDown

MakeColumnSelectMenu() public méthode

Append the column selection menu items to the given menu strip.
public MakeColumnSelectMenu ( ToolStripDropDown strip ) : ToolStripDropDown
strip ToolStripDropDown The menu to which the items will be added.
Résultat ToolStripDropDown

MakeDefaultCellEditor() protected méthode

Return a TextBox that can be used as a default cell editor.
protected MakeDefaultCellEditor ( OLVColumn column ) : Control
column OLVColumn What column does the cell belong to?
Résultat Control

MakeFilteringMenu() public méthode

Create a Filtering menu
public MakeFilteringMenu ( ToolStripDropDown strip, int columnIndex ) : ToolStripDropDown
strip ToolStripDropDown
columnIndex int
Résultat ToolStripDropDown

MakeGroups() protected méthode

Make a list of groups that should be shown according to the given parameters
This should not change the state of the control. It is possible that the groups created will not be used. They may simply be discarded.
protected MakeGroups ( GroupingParameters parms ) : IList
parms GroupingParameters
Résultat IList

MakeHeaderRightClickMenu() protected méthode

Create the menu that should be displayed when the user right clicks on the given column header.
protected MakeHeaderRightClickMenu ( int columnIndex ) : ToolStripDropDown
columnIndex int Index of the column that was right clicked. /// This can be negative, which indicates a click outside of any header.
Résultat ToolStripDropDown

MakeSortIndicatorImages() protected méthode

If the sort indicator images don't already exist, this method will make and install them
protected MakeSortIndicatorImages ( ) : void
Résultat void

MarkUrlVisited() public méthode

Remember that the given URL has been visited
This does not cause the control be redrawn
public MarkUrlVisited ( string url ) : void
url string The url to be remembered
Résultat void

ModelToItem() public méthode

Return the OLVListItem that displays the given model object
This method has O(n) performance.
public ModelToItem ( object modelObject ) : OLVListItem
modelObject object The modelObject whose item is to be found
Résultat OLVListItem

MoveObjects() public méthode

Move the given collection of objects to the given index.
This operation only makes sense on non-grouped ObjectListViews.
public MoveObjects ( int index, ICollection modelObjects ) : void
index int
modelObjects ICollection
Résultat void

ObjectListView() public méthode

Create an ObjectListView
public ObjectListView ( ) : System
Résultat System

ObjectsToHtml() public méthode

Return a html representation of the given objects
public ObjectsToHtml ( IList objectsToConvert ) : string
objectsToConvert IList
Résultat string

OlvHitTest() public méthode

What is under the given point? This takes the various parts of a cell into accout, including any custom parts that a custom renderer might use
public OlvHitTest ( int x, int y ) : OlvListViewHitTestInfo
x int
y int
Résultat OlvListViewHitTestInfo

OnColumnReordered() protected méthode

Override the OnColumnReordered method to do what we want
protected OnColumnReordered ( ColumnReorderedEventArgs e ) : void
e ColumnReorderedEventArgs
Résultat void

OnControlCreated() protected méthode

This method is called after the control has been fully created.
protected OnControlCreated ( ) : void
Résultat void

OnDragDrop() protected méthode

protected OnDragDrop ( DragEventArgs args ) : void
args DragEventArgs
Résultat void

OnDragEnter() protected méthode

protected OnDragEnter ( DragEventArgs args ) : void
args DragEventArgs
Résultat void

OnDragLeave() protected méthode

protected OnDragLeave ( EventArgs e ) : void
e EventArgs
Résultat void

OnDragOver() protected méthode

protected OnDragOver ( DragEventArgs args ) : void
args DragEventArgs
Résultat void

OnDrawColumnHeader() protected méthode

Owner draw the column header
protected OnDrawColumnHeader ( DrawListViewColumnHeaderEventArgs e ) : void
e DrawListViewColumnHeaderEventArgs
Résultat void

OnDrawItem() protected méthode

Owner draw the item
protected OnDrawItem ( DrawListViewItemEventArgs e ) : void
e DrawListViewItemEventArgs
Résultat void

OnDrawSubItem() protected méthode

Owner draw a single subitem
protected OnDrawSubItem ( DrawListViewSubItemEventArgs e ) : void
e DrawListViewSubItemEventArgs
Résultat void

OnGiveFeedback() protected méthode

protected OnGiveFeedback ( GiveFeedbackEventArgs args ) : void
args GiveFeedbackEventArgs
Résultat void

OnHandleCreated() protected méthode

Called when the handle of the underlying control is created
protected OnHandleCreated ( EventArgs e ) : void
e EventArgs
Résultat void

OnItemDrag() protected méthode

protected OnItemDrag ( ItemDragEventArgs e ) : void
e ItemDragEventArgs
Résultat void

OnMouseDown() protected méthode

We need the click count in the mouse up event, but that is always 1. So we have to remember the click count from the preceding mouse down event.
protected OnMouseDown ( MouseEventArgs e ) : void
e MouseEventArgs
Résultat void

OnMouseLeave() protected méthode

When the mouse leaves the control, remove any hot item highlighting
protected OnMouseLeave ( EventArgs e ) : void
e EventArgs
Résultat void

OnMouseMove() protected méthode

When the mouse moves, we might need to change the hot item.
protected OnMouseMove ( MouseEventArgs e ) : void
e MouseEventArgs
Résultat void

OnMouseUp() protected méthode

Check to see if we need to start editing a cell
protected OnMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
Résultat void

OnQueryContinueDrag() protected méthode

protected OnQueryContinueDrag ( QueryContinueDragEventArgs args ) : void
args QueryContinueDragEventArgs
Résultat void

OnRightMouseUp() protected méthode

The user right clicked on the control
protected OnRightMouseUp ( MouseEventArgs e ) : void
e MouseEventArgs
Résultat void

OnSelectedIndexChanged() protected méthode

This method is called every time a row is selected or deselected. This can be a pain if the user shift-clicks 100 rows. We override this method so we can trigger one event for any number of select/deselects that come from one user action
protected OnSelectedIndexChanged ( EventArgs e ) : void
e EventArgs
Résultat void

PauseAnimations() public méthode

Pause (or unpause) all animations in the list
public PauseAnimations ( bool isPause ) : void
isPause bool true to pause, false to unpause
Résultat void

PossibleFinishCellEditing() public méthode

If a cell edit is in progress, finish the edit.
This method does not guarantee that the editing will finish. The validation process can cause the finishing to be aborted. Developers should check the return value or use IsCellEditing property after calling this method to see if the user is still editing a cell.
public PossibleFinishCellEditing ( ) : bool
Résultat bool

PossibleFinishCellEditing() public méthode

If a cell edit is in progress, finish the edit.
This method does not guarantee that the editing will finish. The validation process can cause the finishing to be aborted. Developers should check the return value or use IsCellEditing property after calling this method to see if the user is still editing a cell.
public PossibleFinishCellEditing ( bool expectingCellEdit ) : bool
expectingCellEdit bool True if it is likely that another cell is going to be /// edited immediately after this cell finishes editing
Résultat bool

PostProcessOneRow() protected méthode

Do the work required after one item in a listview have been created
protected PostProcessOneRow ( int rowIndex, int displayIndex, OLVListItem olvi ) : void
rowIndex int
displayIndex int
olvi OLVListItem
Résultat void

PostProcessRows() protected méthode

Do the work required after the items in a listview have been created
protected PostProcessRows ( ) : void
Résultat void

ProcessDialogKey() protected méthode

Handle a key press on this control. We specifically look for F2 which edits the primary column, or a Tab character during an edit operation, which tries to start editing on the next (or previous) cell.
protected ProcessDialogKey ( Keys keyData ) : bool
keyData Keys
Résultat bool

ProcessHyperlinkClicked() protected méthode

Tell the world that a hyperlink was clicked and if the event isn't handled, do the default processing.
protected ProcessHyperlinkClicked ( CellClickEventArgs e ) : void
e CellClickEventArgs
Résultat void

ProcessLButtonDoubleClick() protected méthode

Handle a mouse double click at the given hit test location
Subclasses can override this to do something unique
protected ProcessLButtonDoubleClick ( OlvListViewHitTestInfo hti ) : bool
hti OlvListViewHitTestInfo
Résultat bool

ProcessLButtonDown() protected méthode

Handle a left mouse down at the given hit test location
Subclasses can override this to do something unique
protected ProcessLButtonDown ( OlvListViewHitTestInfo hti ) : bool
hti OlvListViewHitTestInfo
Résultat bool

ProcessRButtonDoubleClick() protected méthode

Handle a right mouse double click at the given hit test location
Subclasses can override this to do something unique
protected ProcessRButtonDoubleClick ( OlvListViewHitTestInfo hti ) : bool
hti OlvListViewHitTestInfo
Résultat bool

ProcessRButtonDown() protected méthode

Handle a left mouse down at the given hit test location
Subclasses can override this to do something unique
protected ProcessRButtonDown ( OlvListViewHitTestInfo hti ) : bool
hti OlvListViewHitTestInfo
Résultat bool

PutCheckState() protected méthode

Record the change of checkstate for the given object in the model. This does not update the UI -- only the model
protected PutCheckState ( Object modelObject, CheckState state ) : CheckState
modelObject Object
state CheckState
Résultat CheckState

RebuildColumns() public méthode

Rebuild the columns based upon its current view and column visibility settings
public RebuildColumns ( ) : void
Résultat void

RefreshHotItem() public méthode

Force the hot item to be recalculated
public RefreshHotItem ( ) : void
Résultat void

RefreshItem() public méthode

Update the ListViewItem with the data from its associated model.
This method does not resort or regroup the view. It simply updates the displayed data of the given item
public RefreshItem ( OLVListItem olvi ) : void
olvi OLVListItem
Résultat void

RefreshObject() public méthode

Update the rows that are showing the given objects
This method does not resort or regroup the view.
public RefreshObject ( object modelObject ) : void
modelObject object
Résultat void

RefreshObjects() public méthode

Update the rows that are showing the given objects

This method does not resort or regroup the view.

This method can safely be called from background threads.

public RefreshObjects ( IList modelObjects ) : void
modelObjects IList
Résultat void

RefreshOverlay() public méthode

Refresh the display of just one overlays
public RefreshOverlay ( IOverlay overlay ) : void
overlay IOverlay
Résultat void

RefreshOverlays() public méthode

Refresh the display of the overlays
public RefreshOverlays ( ) : void
Résultat void

RefreshSelectedObjects() public méthode

Update the rows that are selected
This method does not resort or regroup the view.
public RefreshSelectedObjects ( ) : void
Résultat void

RemoveDecoration() public méthode

Remove the given decoration from this list
public RemoveDecoration ( IDecoration decoration ) : void
decoration IDecoration The decoration to remove
Résultat void

RemoveObject() public méthode

Remove the given model object from the ListView
See RemoveObjects() for more details

This method is thread-safe.

public RemoveObject ( object modelObject ) : void
modelObject object The model to be removed
Résultat void

RemoveObjects() public méthode

Remove all of the given objects from the control.

Nulls and model objects that are not in the ListView are silently ignored.

This method is thread-safe.

public RemoveObjects ( ICollection modelObjects ) : void
modelObjects ICollection Collection of objects to be removed
Résultat void

RemoveOverlay() public méthode

Remove the given overlay to those on this list
public RemoveOverlay ( IOverlay overlay ) : void
overlay IOverlay The overlay
Résultat void

Reset() public méthode

Make the list forget everything -- all rows and all columns
Use ClearObjects if you want to remove just the rows.
public Reset ( ) : void
Résultat void

ResetColumnFiltering() public méthode

Remove all column filtering.
public ResetColumnFiltering ( ) : void
Résultat void

ResizeFreeSpaceFillingColumns() protected méthode

Resize our space filling columns so they fill any unoccupied width in the control
protected ResizeFreeSpaceFillingColumns ( ) : void
Résultat void

ResizeFreeSpaceFillingColumns() protected méthode

Resize our space filling columns so they fill any unoccupied width in the control
protected ResizeFreeSpaceFillingColumns ( int freeSpace ) : void
freeSpace int
Résultat void

RestoreState() public méthode

Restore the state of the control from the given string, which must have been produced by SaveState()
public RestoreState ( byte state ) : bool
state byte A byte array returned from SaveState()
Résultat bool

SaveState() public méthode

Return a byte array that represents the current state of the ObjectListView, such that the state can be restored by RestoreState()

The state of an ObjectListView includes the attributes that the user can modify: current view (i.e. Details, Tile, Large Icon...) sort column and direction column order column widths column visibility

It does not include selection or the scroll position.

public SaveState ( ) : byte[]
Résultat byte[]

SelectAll() public méthode

Select all rows in the listview
public SelectAll ( ) : void
Résultat void

SelectObject() public méthode

Select the row that is displaying the given model object, in addition to any current selection.
Use the SelectedObject property to deselect all other rows
public SelectObject ( object modelObject ) : void
modelObject object The object to be selected
Résultat void

SelectObject() public méthode

Select the row that is displaying the given model object, in addition to any current selection.
Use the SelectedObject property to deselect all other rows
public SelectObject ( object modelObject, bool setFocus ) : void
modelObject object The object to be selected
setFocus bool Should the object be focused as well?
Résultat void

SelectObjects() public méthode

Select the rows that is displaying any of the given model object. All other rows are deselected.
public SelectObjects ( IList modelObjects ) : void
modelObjects IList A collection of model objects
Résultat void

SetControlValue() protected méthode

Try to give the given value to the provided control. Fall back to assigning a string if the value assignment fails.
protected SetControlValue ( Control control, Object value, String stringValue ) : void
control Control A control
value Object The value to be given to the control
stringValue String The string to be given if the value doesn't work
Résultat void

SetNativeBackgroundImage() public méthode

Set the given image to be background of the ListView so that it appears at the given percentage offsets within the list.

This has the same limitations as described in SetNativeBackgroundWatermark. Make sure those limitations are understood before using the method.

This is very similar to setting the System.Windows.Forms.Control.BackgroundImage property of the standard .NET ListView, except that the standard BackgroundImage does not handle images with transparent areas properly -- it renders transparent areas as black. This method does not have that problem.

Setting this clears any background watermark.

public SetNativeBackgroundImage ( Image image, int xOffset, int yOffset ) : void
image Image The image to be drawn. If null, any existing image will be removed.
xOffset int The horizontal percentage where the image will be placed. 0 is absolute left, 100 is absolute right.
yOffset int The vertical percentage where the image will be placed.
Résultat void

SetNativeBackgroundTiledImage() public méthode

Set the given image to be the tiled background of the ListView.

This has the same limitations as described in SetNativeBackgroundWatermark and SetNativeBackgroundImage. Make sure those limitations are understood before using the method.

public SetNativeBackgroundTiledImage ( Image image ) : void
image Image The image to be drawn. If null, any existing image will be removed.
Résultat void

SetNativeBackgroundWatermark() public méthode

Set the given image to be fixed in the bottom right of the list view. This image will not scroll when the list view scrolls.

This method uses ListView's native ability to display a background image. It has a few limitations:

It doesn't work well with owner drawn mode. In owner drawn mode, each cell draws itself, including its background, which covers the background image. It doesn't look very good when grid lines are enabled, since the grid lines are drawn over the image. It does not work at all on XP. Obviously, it doesn't look good when alternate row background colors are enabled.

If you can live with these limitations, native watermarks are quite neat. They are true backgrounds, not translucent overlays like the OverlayImage uses. They also have the decided advantage over overlays in that they work correctly even in MDI applications.

Setting this clears any background image.

public SetNativeBackgroundWatermark ( Image image ) : void
image Image The image to be drawn. If null, any existing image will be removed.
Résultat void

SetObjectCheckedness() protected méthode

Change the check state of the given object to be the given state.
If the given model object isn't in the list, we still try to remember its state, in case it is referenced in the future.
protected SetObjectCheckedness ( object modelObject, CheckState state ) : void
modelObject object
state CheckState
Résultat void

SetObjects() public méthode

Set the collection of objects that will be shown in this list view.
The list is updated immediately
public SetObjects ( IEnumerable collection ) : void
collection IEnumerable The objects to be displayed
Résultat void

SetObjects() public méthode

Set the collection of objects that will be shown in this list view.
The list is updated immediately
public SetObjects ( IEnumerable collection, bool preserveState ) : void
collection IEnumerable The objects to be displayed
preserveState bool Should the state of the list be preserved as far as is possible.
Résultat void

SetPersistentCheckState() protected méthode

Remember the check state of the given model object
protected SetPersistentCheckState ( object model, CheckState state ) : CheckState
model object The model to be remembered
state CheckState The model's checkedness
Résultat CheckState

SetSubItemImage() public méthode

Set the subitem image natively
public SetSubItemImage ( int rowIndex, int subItemIndex, OLVListSubItem subItem, bool shouldClearImages ) : void
rowIndex int
subItemIndex int
subItem OLVListSubItem
shouldClearImages bool
Résultat void

SetSubItemImages() protected méthode

Tell the underlying list control which images to show against the subitems
protected SetSubItemImages ( int rowIndex, OLVListItem item ) : void
rowIndex int the index at which the item occurs
item OLVListItem the item whose subitems are to be set
Résultat void

SetSubItemImages() protected méthode

Tell the underlying list control which images to show against the subitems
protected SetSubItemImages ( int rowIndex, OLVListItem item, bool shouldClearImages ) : void
rowIndex int the index at which the item occurs
item OLVListItem the item whose subitems are to be set
shouldClearImages bool will existing images be cleared if no new image is provided?
Résultat void

SetupSubItemCheckBoxes() public méthode

Setup this control so it can display check boxes on subitems (or primary checkboxes in virtual mode)
This gives the ListView a small image list, if it doesn't already have one.
public SetupSubItemCheckBoxes ( ) : void
Résultat void

ShouldStartCellEdit() protected méthode

Should we start editing the cell in response to the given mouse button event?
protected ShouldStartCellEdit ( MouseEventArgs e ) : bool
e MouseEventArgs
Résultat bool

ShowHeaderRightClickMenu() protected méthode

Show a menu that is appropriate when the given column header is clicked.
protected ShowHeaderRightClickMenu ( int columnIndex, Point pt ) : bool
columnIndex int The index of the header that was clicked. This /// can be -1, indicating that the header was clicked outside of a column
pt Point Where should the menu be shown
Résultat bool

ShowOverlays() public méthode

Make sure that any overlays are visible.
public ShowOverlays ( ) : void
Résultat void

ShowSortIndicator() public méthode

Put a sort indicator next to the text of the sort column
public ShowSortIndicator ( ) : void
Résultat void

ShowSortIndicator() protected méthode

Put a sort indicator next to the text of the given given column
protected ShowSortIndicator ( OLVColumn columnToSort, SortOrder sortOrder ) : void
columnToSort OLVColumn The column to be marked
sortOrder SortOrder The sort order in effect on that column
Résultat void

Sort() public méthode

Sort the items by the last sort column and order
public Sort ( ) : void
Résultat void

Sort() public méthode

Sort the items in the list view by the values in the given column and the last sort order
public Sort ( OLVColumn columnToSort ) : void
columnToSort OLVColumn The column whose values will be used for the sorting
Résultat void

Sort() public méthode

Sort the items in the list view by the values in the given column and by the given order.
If ShowGroups is true, the rows will be grouped by the given column. If AlwaysGroupsByColumn is not null, the rows will be grouped by that column, and the rows within each group will be sorted by the given column.
public Sort ( OLVColumn columnToSort, SortOrder order ) : void
columnToSort OLVColumn The column whose values will be used for the sorting. /// If null, the first column will be used.
order SortOrder The ordering to be used for sorting. If this is None, /// this.Sorting and then SortOrder.Ascending will be used
Résultat void

Sort() public méthode

Sort the items in the list view by the values in the given column and the last sort order
public Sort ( int columnToSortIndex ) : void
columnToSortIndex int The index of the column whose values will be used for the sorting
Résultat void

Sort() public méthode

Sort the items in the list view by the values in the given column and the last sort order
public Sort ( string columnToSortName ) : void
columnToSortName string The name of the column whose values will be used for the sorting
Résultat void

StandardHyperlinkClickedProcessing() protected méthode

Do the default processing for a hyperlink clicked event, which is to try and open the url.
protected StandardHyperlinkClickedProcessing ( HyperlinkClickedEventArgs args ) : void
args HyperlinkClickedEventArgs
Résultat void

StartCellEdit() public méthode

Really start an edit operation on a given cell. The parameters are assumed to be sane.
public StartCellEdit ( OLVListItem item, int subItemIndex ) : void
item OLVListItem The row to be edited
subItemIndex int The index of the cell to be edited
Résultat void

TakeOwnershipOfObjects() protected méthode

Take ownership of the 'objects' collection. This separats our collection from the source.

This method separates the 'objects' instance variable from its source, so that any AddObject/RemoveObject calls will modify our collection and not the original colleciton.

This method has the intentional side-effect of converting our list of objects to an ArrayList.

protected TakeOwnershipOfObjects ( ) : void
Résultat void

ToggleCheckObject() public méthode

Toggle the checkedness of the given object. A checked object becomes unchecked; an unchecked or indeterminate object becomes checked. If the list has tristate checkboxes, the order is: unchecked -> checked -> indeterminate -> unchecked ...
public ToggleCheckObject ( object modelObject ) : void
modelObject object The model object to be checked
Résultat void

ToggleSubItemCheckBox() public méthode

Toggle the check at the check box of the given cell
public ToggleSubItemCheckBox ( object rowObject, OLVColumn column ) : void
rowObject object
column OLVColumn
Résultat void

TriggerFormatRowEvent() protected méthode

Trigger FormatRow and possibly FormatCell events for the given item
protected TriggerFormatRowEvent ( int rowIndex, int displayIndex, OLVListItem olvi ) : void
rowIndex int
displayIndex int
olvi OLVListItem
Résultat void

TriggerGroupExpandCollapse() protected méthode

Trigger a GroupExpandCollapse event and return true if the action was cancelled
protected TriggerGroupExpandCollapse ( OLVGroup group ) : bool
group OLVGroup
Résultat bool

UnapplyHotItem() protected méthode

Remove hot item styling from the given row
protected UnapplyHotItem ( int index ) : void
index int
Résultat void

UncheckObject() public méthode

Mark the given object as unchecked in the list
public UncheckObject ( object modelObject ) : void
modelObject object The model object to be unchecked
Résultat void

UncheckObjects() public méthode

Mark the given objects as unchecked in the list
public UncheckObjects ( IEnumerable modelObjects ) : void
modelObjects IEnumerable The model object to be checked
Résultat void

UncheckSubItem() public méthode

Uncheck the check at the given cell
public UncheckSubItem ( object rowObject, OLVColumn column ) : void
rowObject object
column OLVColumn
Résultat void

Unfreeze() public méthode

Unfreeze the listview. If this call is the outermost Unfreeze(), the contents of the listview will be rebuilt.
Freeze()/Unfreeze() calls nest correctly
public Unfreeze ( ) : void
Résultat void

Unsort() public méthode

Remove any sorting and revert to the given order of the model objects
public Unsort ( ) : void
Résultat void

UpdateCellToolTipHandle() protected méthode

Update the handle used by our cell tooltip to be the tooltip used by the underlying Windows listview control.
protected UpdateCellToolTipHandle ( ) : void
Résultat void

UpdateColumnFiltering() public méthode

Update the filtering of this ObjectListView based on the value filtering defined in each column
public UpdateColumnFiltering ( ) : void
Résultat void

UpdateFiltering() protected méthode

When some setting related to filtering changes, this method is called.
protected UpdateFiltering ( ) : void
Résultat void

UpdateHotItem() protected méthode

The mouse has moved to the given pt. See if the hot item needs to be updated
This is the main entry point for hot item handling
protected UpdateHotItem ( OlvListViewHitTestInfo hti ) : void
hti OlvListViewHitTestInfo
Résultat void

UpdateHotItem() protected méthode

The mouse has moved to the given pt. See if the hot item needs to be updated
This is the main entry point for hot item handling
protected UpdateHotItem ( Point pt ) : void
pt Point Where is the mouse?
Résultat void

UpdateHotRow() protected méthode

Update the given row using the current hot item information
protected UpdateHotRow ( OLVListItem olvi ) : void
olvi OLVListItem
Résultat void

UpdateHotRow() protected méthode

Update the given row using the given hot item information
protected UpdateHotRow ( int rowIndex, int columnIndex, HitTestLocation hitLocation, OLVListItem olvi ) : void
rowIndex int
columnIndex int
hitLocation HitTestLocation
olvi OLVListItem
Résultat void

UpdateNotificationSubscriptions() protected méthode

Change any subscriptions to INotifyPropertyChanged events on our current model objects so that we no longer listen for events on the old models and do listen for events on the given collection.
This does nothing if UseNotifyPropertyChanged is false.
protected UpdateNotificationSubscriptions ( IEnumerable collection ) : void
collection IEnumerable
Résultat void

WndProc() protected méthode

Override the basic message pump for this control
protected WndProc ( Message &m ) : void
m Message
Résultat void

Property Details

EditorRegistry public_oe static_oe property

This registry decides what control should be used to edit what cells, based on the type of the value in the cell.
All instances of ObjectListView share the same editor registry.
public static EditorRegistry EditorRegistry
Résultat EditorRegistry

SortAscendingImage public_oe static_oe property

Gets or sets the image that will be place next to the Sort Ascending command
public static Bitmap SortAscendingImage
Résultat Bitmap

SortDescendingImage public_oe static_oe property

Gets or sets the image that will be placed next to the Sort Descending command
public static Bitmap SortDescendingImage
Résultat Bitmap