Wraps IDictionary<string, object>.
Namespace: Dapfor.Net.DataAssembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)
Syntax
C# |
---|
public sealed class DictionaryDataAccessor : IDataAccessor, IEnumerable<IDataField>, IEnumerable |
Visual Basic |
---|
Public NotInheritable Class DictionaryDataAccessor Implements IDataAccessor, IEnumerable(Of IDataField), IEnumerable |
Visual C++ |
---|
public ref class DictionaryDataAccessor sealed : IDataAccessor, IEnumerable<IDataField^>, IEnumerable |
F# |
---|
[<SealedAttribute>] type DictionaryDataAccessor = class interface IDataAccessor interface IEnumerable<IDataField> interface IEnumerable end |
Remarks
Objects of IDictionary<string, object> can be added to grid via Grid.Rows.Add(IDictionary) method:
Copy | |
---|---|
void AddDictionaryObject(Grid grid) { //Configure headers. Top hierarchical level (level 0) grid.Headers.Add(new Header()); grid.Headers[0].Add(new Column("column1")); grid.Headers[0].Add(new Column("column2")); grid.Headers[0].Add(new Column("column3")); //Configure headers at hierarchical level 1. grid.Headers.Add(new Header()); grid.Headers[1].Add(new Column("column_connected")); grid.Headers[1].Add(new Column("column_idle")); //Add the object Hashtable hashTable = new Hashtable(); hashTable.Add("column1", 10); hashTable.Add("column2", DateTime.Now); hashTable.Add("column3", 123.45); grid.Rows.Add(hashTable); //Add some hierarchy... Dictionary<string, bool> flags = new Dictionary<string, bool>(); flags.Add("column_connected", true); flags.Add("column_idle", false); grid.Rows[0].Add(flags); } |