Wraps enumerable objects.

Namespace: Dapfor.Net.Data
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)

Syntax

C#
public sealed class EnumerableDataAccessor : IDataAccessor, 
	IEnumerable<IDataField>, IEnumerable
Visual Basic
Public NotInheritable Class EnumerableDataAccessor
	Implements IDataAccessor, IEnumerable(Of IDataField), 
	IEnumerable
Visual C++
public ref class EnumerableDataAccessor sealed : IDataAccessor, 
	IEnumerable<IDataField^>, IEnumerable
F#
[<SealedAttribute>]
type EnumerableDataAccessor =  
    class
        interface IDataAccessor
        interface IEnumerable<IDataField>
        interface IEnumerable
    end

Remarks

Objects of IEnumerable type can be added to grid via Grid.Rows.Add(object) method:
 Copy imageCopy
public void AddEnumerableCollection(Grid grid)
{
    grid.Headers.Add(new Header());
    grid.Headers[0].Add(new Column("Column 1"));
    grid.Headers[0].Add(new Column("Column 2"));
    grid.Headers[0].Add(new Column("Column 3"));

    string[] collection = new string[] { "cell 11", "cell 12", "cell 13" };

    //The collection implements IList interface and is wrapped by the ListDataAccessor
    grid.Rows.Add(collection);

    //The collection implements IList interface and is wrapped explicitly by the ListDataAccessor
    grid.Rows.Add(new ListDataAccessor(collection));

    //The next code adds the same collection to the grid, but wrapped by the EnumerableDataAccessor
    grid.Rows.Add(new EnumerableDataAccessor(collection));
}

Inheritance Hierarchy

System..::..Object
  Dapfor.Net.Data..::..EnumerableDataAccessor

See Also