Class ListView
ListView widget renders a list of data.
Inherited Members
Namespace: Terminal.Gui
Assembly: Terminal.Gui.dll
Syntax
public class ListView : Terminal.Gui.View
Constructors
ListView(Rect, IList)
Initializes a new ListView that will display the contents of the object implementing the IList interface.
Declaration
public ListView (Terminal.Gui.Rect rect, System.Collections.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. |
ListView(Rect, IListDataSource)
Initializes a new ListView that will display the provided data source.
Declaration
public ListView (Terminal.Gui.Rect rect, Terminal.Gui.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
AllowsMarking
Gets or sets a value indicating whether this ListView allows items to be marked.
Declaration
public bool AllowsMarking { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
SelectedItem
Gets or sets the currently selecteded item.
Declaration
public int SelectedItem { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The selected item. |
Source
Gets or sets the IListDataSource backing this view, use SetSource() if you want to set a new IList source.
Declaration
public Terminal.Gui.IListDataSource Source { get; set; }
Property Value
Type | Description |
---|---|
IListDataSource | The 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
MouseEvent(MouseEvent)
Declaration
public override bool MouseEvent (Terminal.Gui.MouseEvent me);
Parameters
Type | Name | Description |
---|---|---|
MouseEvent | me | To be added. |
Returns
Type | Description |
---|---|
System.Boolean | To be added. |
PositionCursor()
Positions the cursor in this view
Declaration
public override void PositionCursor ();
ProcessKey(KeyEvent)
Handles cursor movement for this view, passes all other events.
Declaration
public override bool ProcessKey (Terminal.Gui.KeyEvent kb);
Parameters
Type | Name | Description |
---|---|---|
KeyEvent | kb | Keyboard event. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Redraw(Rect)
Redraws the ListView
Declaration
public override void Redraw (Terminal.Gui.Rect region);
Parameters
Type | Name | Description |
---|---|---|
Rect | region | Region. |
SetSource(IList)
Sets the source to an IList value, if you want to set a full IListDataSource, use the Source property.
Declaration
public void SetSource (System.Collections.IList source);
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IList | source | To be added. |
Events
SelectedChanged
This event is raised when the cursor selection has changed.
Declaration
public event Action SelectedChanged;
Event Type
Type | Description |
---|---|
System.Action | To be added. |