Files
docs-desktop/dotnet-desktop-guide/framework/winforms/how-to-implement-the-ilistsource-interface.md
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

2.5 KiB

title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title ms.date dev_langs helpviewer_keywords ms.assetid
How to: Implement the IListSource Interface 03/30/2017
csharp
vb
data binding [Windows Forms], implementing
IListSource interface
63ce27aa-2e23-4fbd-8228-0c1726f6c421

How to: Implement the IListSource Interface

Implement the xref:System.ComponentModel.IListSource interface to create a bindable class that does not implement xref:System.Collections.IList but instead provides a list from another location.

Example

The following code example demonstrates how to implement the xref:System.ComponentModel.IListSource interface. A component named EmployeeListSource exposes an xref:System.Collections.IList for data binding by implementing the xref:System.ComponentModel.IListSource.GetList%2A method.

[!code-csharpSystem.ComponentModel.IListSource#1] [!code-vbSystem.ComponentModel.IListSource#1]

[!code-csharpSystem.ComponentModel.IListSource#10] [!code-vbSystem.ComponentModel.IListSource#10]

[!code-csharpSystem.ComponentModel.IListSource#100] [!code-vbSystem.ComponentModel.IListSource#100]

[!code-csharpSystem.ComponentModel.IListSource#1000] [!code-vbSystem.ComponentModel.IListSource#1000]

Compiling the Code

This example requires:

  • References to the System.Drawing and System.Windows.Forms assemblies.

See also