Class ListView
ListView
View renders a scrollable list of data where each item can be activated to perform an action.
Inheritance
System.Object
ListView
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Terminal.Gui.dll
Syntax
public class ListView : View, IDisposable, ISupportInitializeNotification, ISupportInitialize
Constructors
|
Improve this Doc
View Source
ListView()
Initializes a new instance of
ListView. Set the
Source property to display something.
Declaration
|
Improve this Doc
View Source
ListView(IList)
Initializes a new instance of
ListView that will display the contents of the object implementing the
System.Collections.IList interface,
with relative positioning.
Declaration
public ListView(IList source)
Parameters
| Type |
Name |
Description |
| System.Collections.IList |
source |
An System.Collections.IList data source, if the elements are strings or ustrings, the string is rendered, otherwise the ToString() method is invoked on the result. |
|
Improve this Doc
View Source
ListView(IListDataSource)
Initializes a new instance of
ListView that will display the provided data source, using relative positioning.
Declaration
public ListView(IListDataSource source)
Parameters
| Type |
Name |
Description |
| IListDataSource |
source |
IListDataSource object that provides a mechanism to render the data.
The number of elements on the collection should not change, if you must change, set
the "Source" property to reset the internal settings of the ListView. |
|
Improve this Doc
View Source
ListView(Rect, IList)
Initializes a new instance of
ListView that will display the contents of the object implementing the
System.Collections.IList interface with an absolute position.
Declaration
public ListView(Rect rect, IList source)
Parameters
| Type |
Name |
Description |
| Rect |
rect |
Frame for the listview. |
| System.Collections.IList |
source |
An IList data source, if the elements of the IList are strings or ustrings, the string is rendered, otherwise the ToString() method is invoked on the result. |
|
Improve this Doc
View Source
ListView(Rect, IListDataSource)
Initializes a new instance of
ListView with the provided data source and an absolute position
Declaration
public ListView(Rect rect, IListDataSource source)
Parameters
| Type |
Name |
Description |
| Rect |
rect |
Frame for the listview. |
| IListDataSource |
source |
IListDataSource object that provides a mechanism to render the data. The number of elements on the collection should not change, if you must change, set the "Source" property to reset the internal settings of the ListView. |
Properties
|
Improve this Doc
View Source
AllowsMarking
Gets or sets whether this
ListView allows items to be marked.
Declaration
public bool AllowsMarking { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
true if allows marking elements of the list; otherwise, false.
|
|
Improve this Doc
View Source
AllowsMultipleSelection
If set to true allows more than one item to be selected. If false only allow one item selected.
Declaration
public bool AllowsMultipleSelection { get; set; }
Property Value
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
LeftItem
Gets or sets the left column where the item start to be displayed at on the
ListView.
Declaration
public int LeftItem { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
The left position. |
|
Improve this Doc
View Source
Maxlength
Gets the widest item.
Declaration
public int Maxlength { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
|
Improve this Doc
View Source
SelectedItem
Gets or sets the index of the currently selected item.
Declaration
public int SelectedItem { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
The selected item. |
|
Improve this Doc
View Source
Source
Declaration
public IListDataSource Source { get; set; }
Property Value
|
Improve this Doc
View Source
TopItem
Gets or sets the item that is displayed at the top of the
ListView.
Declaration
public int TopItem { get; set; }
Property Value
| Type |
Description |
| System.Int32 |
The top item. |
Methods
|
Improve this Doc
View Source
AllowsAll()
Prevents marking if it's not allowed mark and if it's not allows multiple selection.
Declaration
public virtual bool AllowsAll()
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
MarkUnmarkRow()
Marks an unmarked row.
Declaration
public virtual bool MarkUnmarkRow()
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
MouseEvent(MouseEvent)
Declaration
public override bool MouseEvent(MouseEvent me)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
|
Improve this Doc
View Source
MoveDown()
Moves the selected item index to the next row.
Declaration
public virtual bool MoveDown()
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
MoveEnd()
Moves the selected item index to the last row.
Declaration
public virtual bool MoveEnd()
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
MoveHome()
Moves the selected item index to the first row.
Declaration
public virtual bool MoveHome()
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
MovePageDown()
Moves the selected item index to the previous page.
Declaration
public virtual bool MovePageDown()
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
MovePageUp()
Moves the selected item index to the next page.
Declaration
public virtual bool MovePageUp()
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
MoveUp()
Moves the selected item index to the previous row.
Declaration
public virtual bool MoveUp()
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
OnEnter(View)
Declaration
public override bool OnEnter(View view)
Parameters
| Type |
Name |
Description |
| View |
view |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
|
Improve this Doc
View Source
OnLeave(View)
Declaration
public override bool OnLeave(View view)
Parameters
| Type |
Name |
Description |
| View |
view |
|
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
|
Improve this Doc
View Source
OnOpenSelectedItem()
Invokes the OnOpenSelectedItem event if it is defined.
Declaration
public virtual bool OnOpenSelectedItem()
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
OnRowRender(ListViewRowEventArgs)
Virtual method that will invoke the
RowRender.
Declaration
public virtual void OnRowRender(ListViewRowEventArgs rowEventArgs)
Parameters
|
Improve this Doc
View Source
OnSelectedChanged()
Invokes the SelectedChanged event if it is defined.
Declaration
public virtual bool OnSelectedChanged()
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
PositionCursor()
Declaration
public override void PositionCursor()
Overrides
|
Improve this Doc
View Source
ProcessKey(KeyEvent)
Declaration
public override bool ProcessKey(KeyEvent kb)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
Overrides
|
Improve this Doc
View Source
Redraw(Rect)
Declaration
public override void Redraw(Rect bounds)
Parameters
| Type |
Name |
Description |
| Rect |
bounds |
|
Overrides
|
Improve this Doc
View Source
Scrolls the view down.
Declaration
public virtual bool ScrollDown(int lines)
Parameters
| Type |
Name |
Description |
| System.Int32 |
lines |
Number of lines to scroll down. |
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Scrolls the view left.
Declaration
public virtual bool ScrollLeft(int cols)
Parameters
| Type |
Name |
Description |
| System.Int32 |
cols |
Number of columns to scroll left. |
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Scrolls the view right.
Declaration
public virtual bool ScrollRight(int cols)
Parameters
| Type |
Name |
Description |
| System.Int32 |
cols |
Number of columns to scroll right. |
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
Scrolls the view up.
Declaration
public virtual bool ScrollUp(int lines)
Parameters
| Type |
Name |
Description |
| System.Int32 |
lines |
Number of lines to scroll up. |
Returns
| Type |
Description |
| System.Boolean |
|
|
Improve this Doc
View Source
SetSource(IList)
Sets the source of the
ListView to an
System.Collections.IList.
Declaration
public void SetSource(IList source)
Parameters
| Type |
Name |
Description |
| System.Collections.IList |
source |
|
|
Improve this Doc
View Source
SetSourceAsync(IList)
Sets the source to an System.Collections.IList value asynchronously.
Declaration
public Task SetSourceAsync(IList source)
Parameters
| Type |
Name |
Description |
| System.Collections.IList |
source |
|
Returns
| Type |
Description |
| System.Threading.Tasks.Task |
An item implementing the IList interface. |
Events
|
Improve this Doc
View Source
OpenSelectedItem
This event is raised when the user Double Clicks on an item or presses ENTER to open the selected item.
Declaration
public event Action<ListViewItemEventArgs> OpenSelectedItem
Event Type
|
Improve this Doc
View Source
RowRender
This event is invoked when this
ListView is being drawn before rendering.
Declaration
public event Action<ListViewRowEventArgs> RowRender
Event Type
|
Improve this Doc
View Source
SelectedItemChanged
This event is raised when the selected item in the
ListView has changed.
Declaration
public event Action<ListViewItemEventArgs> SelectedItemChanged
Event Type
Implements
System.IDisposable
System.ComponentModel.ISupportInitializeNotification
System.ComponentModel.ISupportInitialize