# C1.Win.FlexGrid.MultiColumnDictionary

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Win_FlexGrid_MultiColumnDictionary" data-uid="C1.Win.FlexGrid.MultiColumnDictionary" class="text-break">MultiColumnDictionary Class
</h1>
  <div class="markdown level0 summary"><p>Class that implements the <a class="xref" href="C1.Win.FlexGrid.IC1MultiColumnDictionary.html">IC1MultiColumnDictionary</a> and can be used as
a column DataMap to create multi-column combo editors.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.listdictionary">ListDictionary</a></div>
    <div class="level2"><span class="xref">MultiColumnDictionary</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="C1.Win.FlexGrid.IC1MultiColumnDictionary2.html">IC1MultiColumnDictionary2</a></div>
    <div><a class="xref" href="C1.Win.FlexGrid.IC1MultiColumnDictionary.html">IC1MultiColumnDictionary</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.idictionary">IDictionary</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.icollection">ICollection</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ienumerable">IEnumerable</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Win.FlexGrid.html">C1.Win.FlexGrid</a></h6>
  <h6><strong>Assembly</strong>: C1.Win.FlexGrid.10.dll</h6>
  <h5 id="C1_Win_FlexGrid_MultiColumnDictionary_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class MultiColumnDictionary : ListDictionary, IC1MultiColumnDictionary2, IC1MultiColumnDictionary, IDictionary, ICollection, IEnumerable</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class MultiColumnDictionary
    Inherits ListDictionary
    Implements IC1MultiColumnDictionary2, IC1MultiColumnDictionary, IDictionary, ICollection, IEnumerable</code></pre>
  </div>
  <h5 id="C1_Win_FlexGrid_MultiColumnDictionary_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><p>The <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.html">MultiColumnDictionary</a> class can be used to implement simple string-based
data maps or bound data maps that get the data from a data source object.</p>
</div>
  <h5 id="C1_Win_FlexGrid_MultiColumnDictionary_examples"><strong>Examples</strong></h5>
  <p>The code below creates an unbound two-column data map and assigns it to a grid column:</p>
<pre><code class="lang-csharp">// create string-based MultiColumnDictionary and assign it to column
// note: this will automatically generate keys of type 'int' for each item,
// the key values will be stored in the grid.
string text = "Row1, Col1\tRow1, Col2|Row2, Col1\tRow2, Col3|Row2, Col1\tRow3, Col2";
MultiColumnDictionary map = new MultiColumnDictionary(text, 0, true);
_flex.Cols[1].DataMap = map;</code></pre>
<p>The map consists of three items, each with two columns. Because the <b>autoKeys</b>
parameter was set to true in the map's constructor, the map will have unique integer keys for 
each value,and those integers will be stored in the grid cells. If <b>autoKeys</b>
had been set to false, the strings themselves would be used as keys and stored in the grid
cells.</p>
<p>The code below creates a bound data map and assigns it to a grid column:</p>
<pre><code class="lang-csharp">// create data-based MultiColumnDictionary and assign it to column
// notes: the list will automatically be updated is the data source changes.
DataTable dt = GetDataTable("employees");
string[] columnNames = new string[] { "FirstName", "LastName", "Country" };
MultiColumnDictionary map = new MultiColumnDictionary(dt, "EmployeeID", columnNames, 1);
_flex.Cols[2].DataMap = map;</code></pre>
<p>This map is bound to an Employees DataTable. The <b>keyColumn</b> parameter is set
to "EmployeeID", causing this field to be used as a key. When the grid is edited, the values 
stored in the cells will be the employee's ID. However, this value is never displayed be the grid.</p>
<p>The drop-down list will show the employee's first name, last name, and country, as specified by the 
<b>columnNames</b> parameter.</p>
<p>When the list is closed, the grid will display the employee's last name, as specified
by the <b>displayColumn</b> parameter.</p>
<p>Note that this map is dynamically bound to the data source, so if the employees table is
modified, the editor list will reflect the changes automatically.</p>
<p>Note also that the usual combo editing features such as auto-search and double-click cycling
still work.</p>

  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_ComponentModel_ITypedList_System_String_" data-uid="C1.Win.FlexGrid.MultiColumnDictionary.#ctor(System.ComponentModel.ITypedList,System.String)">
          <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.-ctor.html#C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_ComponentModel_ITypedList_System_String_">MultiColumnDictionary(ITypedList, string)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of a bound <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.html">MultiColumnDictionary</a> class.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_ComponentModel_ITypedList_System_String_System_String___System_Int32_" data-uid="C1.Win.FlexGrid.MultiColumnDictionary.#ctor(System.ComponentModel.ITypedList,System.String,System.String[],System.Int32)">
          <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.-ctor.html#C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_ComponentModel_ITypedList_System_String_System_String___System_Int32_">MultiColumnDictionary(ITypedList, string, string[], int)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of a bound <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.html">MultiColumnDictionary</a> class.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_Data_DataTable_System_String_" data-uid="C1.Win.FlexGrid.MultiColumnDictionary.#ctor(System.Data.DataTable,System.String)">
          <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.-ctor.html#C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_Data_DataTable_System_String_">MultiColumnDictionary(DataTable, string)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of a bound <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.html">MultiColumnDictionary</a> class.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_Data_DataTable_System_String_System_String___System_Int32_" data-uid="C1.Win.FlexGrid.MultiColumnDictionary.#ctor(System.Data.DataTable,System.String,System.String[],System.Int32)">
          <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.-ctor.html#C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_Data_DataTable_System_String_System_String___System_Int32_">MultiColumnDictionary(DataTable, string, string[], int)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of a bound <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.html">MultiColumnDictionary</a> class.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_String_" data-uid="C1.Win.FlexGrid.MultiColumnDictionary.#ctor(System.String)">
          <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.-ctor.html#C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_String_">MultiColumnDictionary(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of an unbound <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.html">MultiColumnDictionary</a> class.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_String_System_Int32_System_Boolean_" data-uid="C1.Win.FlexGrid.MultiColumnDictionary.#ctor(System.String,System.Int32,System.Boolean)">
          <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.-ctor.html#C1_Win_FlexGrid_MultiColumnDictionary__ctor_System_String_System_Int32_System_Boolean_">MultiColumnDictionary(string, int, bool)</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of an unbound <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.html">MultiColumnDictionary</a> class.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_FlexGrid_MultiColumnDictionary_Item_System_Object_" data-uid="C1.Win.FlexGrid.MultiColumnDictionary.Item(System.Object)">
          <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.Item.html#C1_Win_FlexGrid_MultiColumnDictionary_Item_System_Object_">this[object]</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the value associated with the specified key</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Win_FlexGrid_MultiColumnDictionary_Add_System_Object_System_Object_" data-uid="C1.Win.FlexGrid.MultiColumnDictionary.Add(System.Object,System.Object)">
          <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.Add.html#C1_Win_FlexGrid_MultiColumnDictionary_Add_System_Object_System_Object_">Add(object, object)</a>
        </td>
        <td class="markdown level1 summary"><p>Adds an entry with the specified key and value into the <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.html">MultiColumnDictionary</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_FlexGrid_MultiColumnDictionary_Clear" data-uid="C1.Win.FlexGrid.MultiColumnDictionary.Clear">
          <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.Clear.html#C1_Win_FlexGrid_MultiColumnDictionary_Clear">Clear()</a>
        </td>
        <td class="markdown level1 summary"><p>Removes all entries from the <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.html">MultiColumnDictionary</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_Win_FlexGrid_MultiColumnDictionary_GetColumnValue_System_Object_System_Int32_" data-uid="C1.Win.FlexGrid.MultiColumnDictionary.GetColumnValue(System.Object,System.Int32)">
          <a class="xref" href="C1.Win.FlexGrid.MultiColumnDictionary.GetColumnValue.html#C1_Win_FlexGrid_MultiColumnDictionary_GetColumnValue_System_Object_System_Int32_">GetColumnValue(object, int)</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the string which is in given column of the dictionary.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
