Show / Hide Table of Contents

# Interface IListDataSource

Implement this interface to provide your own custom rendering for a list.

###### Namespace: Terminal.Gui

###### Assembly: Terminal.Gui.dll

##### Syntax

    public interface IListDataSource

### Properties

#### Count

Returns the number of elements to display

##### Declaration

    public int Count { get; }

##### Property Value

Type | Description
--- | ---
System.Int32 | To be added.

### Methods

#### IsMarked(Int32)

Should return whether the specified item is currently marked.

##### Declaration

    public bool IsMarked (int item);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | item | Item index.

##### Returns

Type | Description
--- | ---
System.Boolean | `true`, if marked, `false` otherwise.

#### Render(Boolean, Int32, Int32, Int32, Int32)

This method is invoked to render a specified item, the method should cover the entire provided width.

##### Declaration

    public void Render (bool selected, int item, int col, int line, int width);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Boolean | selected | Describes whether the item being rendered is currently selected by the user.
System.Int32 | item | The index of the item to render, zero for the first item and so on.
System.Int32 | col | The column where the rendering will start
System.Int32 | line | The line where the rendering will be done.
System.Int32 | width | The width that must be filled out.

##### Remarks

The default color will be set before this method is invoked, and will be based on whether the item is selected or not.

#### Render(ListView, ConsoleDriver, Boolean, Int32, Int32, Int32, Int32)

This method is invoked to render a specified item, the method should cover the entire provided width.

##### Declaration

    public void Render (Terminal.Gui.ListView container, Terminal.Gui.ConsoleDriver driver, bool selected, int item, int col, int line, int width);

##### Parameters

Type | Name | Description
--- | --- | ---
ListView | container | To be added.
ConsoleDriver | driver | To be added.
System.Boolean | selected | Describes whether the item being rendered is currently selected by the user.
System.Int32 | item | The index of the item to render, zero for the first item and so on.
System.Int32 | col | The column where the rendering will start
System.Int32 | line | The line where the rendering will be done.
System.Int32 | width | The width that must be filled out.

##### Remarks

The default color will be set before this method is invoked, and will be based on whether the item is selected or not.

#### SetMark(Int32, Boolean)

Flags the item as marked.

##### Declaration

    public void SetMark (int item, bool value);

##### Parameters

Type | Name | Description
--- | --- | ---
System.Int32 | item | Item index.
System.Boolean | value | If set to `true` value.