# C1.WPF.Schedule.AutoDistributionGrid

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_WPF_Schedule_AutoDistributionGrid" data-uid="C1.WPF.Schedule.AutoDistributionGrid" class="text-break">AutoDistributionGrid Class
</h1>
  <div class="markdown level0 summary"><p>Represents a grid panel that automatically distributes child elements among
grid cells.</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.windows.threading.dispatcherobject">DispatcherObject</a></div>
    <div class="level2"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.dependencyobject">DependencyObject</a></div>
    <div class="level3"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.media.visual">Visual</a></div>
    <div class="level4"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.uielement">UIElement</a></div>
    <div class="level5"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a></div>
    <div class="level6"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.panel">Panel</a></div>
    <div class="level7"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.grid">Grid</a></div>
    <div class="level8"><span class="xref">AutoDistributionGrid</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.media.animation.ianimatable">IAnimatable</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.iframeworkinputelement">IFrameworkInputElement</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.iinputelement">IInputElement</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.isupportinitialize">ISupportInitialize</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.markup.iqueryambient">IQueryAmbient</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.markup.iaddchild">IAddChild</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.WPF.Schedule.html">C1.WPF.Schedule</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.Schedule.4.6.2.dll</h6>
  <h5 id="C1_WPF_Schedule_AutoDistributionGrid_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class AutoDistributionGrid : Grid, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class AutoDistributionGrid
    Inherits Grid
    Implements IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild</code></pre>
  </div>
  <h5 id="C1_WPF_Schedule_AutoDistributionGrid_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><pre><code>&lt;p&gt;
</code></pre>
<p>The <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a> class provides the following additional
functionality to the base Grid class.</p>

    <ul><li><span class="term"></span>
Scatters child elements by rows or columns depending on the 
<a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.ChildrenFlowDirection.html#C1_WPF_Schedule_AutoDistributionGrid_ChildrenFlowDirection">ChildrenFlowDirection</a> property value, with an 
ability
to change a default placement for any child element by specifying the 
<a class="xref" href="C1.WPF.Schedule.DistributionInfo.html">DistributionInfo</a> objects in the 
<a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.ChildrenDistributionInfo.html#C1_WPF_Schedule_AutoDistributionGrid_ChildrenDistributionInfo">ChildrenDistributionInfo</a> collection.
</li><li><span class="term"></span>
Introduces the settable and bindable <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.RowCount.html#C1_WPF_Schedule_AutoDistributionGrid_RowCount">RowCount</a> and 
<a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.ColumnCount.html#C1_WPF_Schedule_AutoDistributionGrid_ColumnCount">ColumnCount</a> properties that allows defining of 
row and column count 
numerically, without adding/removing items in the 
Grid.RowDefinitions/ColumnDefinitions collections. Along with the introduced 
bindable <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.VisualChildCount.html#C1_WPF_Schedule_AutoDistributionGrid_VisualChildCount">VisualChildCount</a> property it gives, for 
example, an ability 
to have as many rows as you have children.
</li><li><span class="term"></span>
Gives an ability to automatically keeps a number of column and rows so as cells
with a fixed width and/or height fully fit in the 
<a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a> size. This is controlled by the
<a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfWidth.html#C1_WPF_Schedule_AutoDistributionGrid_FitCellsOfWidth">FitCellsOfWidth</a> and 
<a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfHeight.html#C1_WPF_Schedule_AutoDistributionGrid_FitCellsOfHeight">FitCellsOfHeight</a> properties.
</li></ul>
</div>
  <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_WPF_Schedule_AutoDistributionGrid__ctor" data-uid="C1.WPF.Schedule.AutoDistributionGrid.#ctor">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.-ctor.html#C1_WPF_Schedule_AutoDistributionGrid__ctor">AutoDistributionGrid()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a new instance of <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="fields">Fields
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_CellCountProperty" data-uid="C1.WPF.Schedule.AutoDistributionGrid.CellCountProperty">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.CellCountProperty.html">CellCountProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.CellCount.html#C1_WPF_Schedule_AutoDistributionGrid_CellCount">CellCount</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_ChildrenFlowDirectionProperty" data-uid="C1.WPF.Schedule.AutoDistributionGrid.ChildrenFlowDirectionProperty">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.ChildrenFlowDirectionProperty.html">ChildrenFlowDirectionProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.ChildrenFlowDirection.html#C1_WPF_Schedule_AutoDistributionGrid_ChildrenFlowDirection">ChildrenFlowDirection</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_ColumnCountProperty" data-uid="C1.WPF.Schedule.AutoDistributionGrid.ColumnCountProperty">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.ColumnCountProperty.html">ColumnCountProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.ColumnCount.html#C1_WPF_Schedule_AutoDistributionGrid_ColumnCount">ColumnCount</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_FitCellsOfHeightProperty" data-uid="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfHeightProperty">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfHeightProperty.html">FitCellsOfHeightProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfHeight.html#C1_WPF_Schedule_AutoDistributionGrid_FitCellsOfHeight">FitCellsOfHeight</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_FitCellsOfWidthProperty" data-uid="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfWidthProperty">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfWidthProperty.html">FitCellsOfWidthProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfWidth.html#C1_WPF_Schedule_AutoDistributionGrid_FitCellsOfWidth">FitCellsOfWidth</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_RowCountProperty" data-uid="C1.WPF.Schedule.AutoDistributionGrid.RowCountProperty">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.RowCountProperty.html">RowCountProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.RowCount.html#C1_WPF_Schedule_AutoDistributionGrid_RowCount">RowCount</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_VisualChildCountProperty" data-uid="C1.WPF.Schedule.AutoDistributionGrid.VisualChildCountProperty">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.VisualChildCountProperty.html">VisualChildCountProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.VisualChildCount.html#C1_WPF_Schedule_AutoDistributionGrid_VisualChildCount">VisualChildCount</a> dependency property.</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_WPF_Schedule_AutoDistributionGrid_CellCount" data-uid="C1.WPF.Schedule.AutoDistributionGrid.CellCount">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.CellCount.html#C1_WPF_Schedule_AutoDistributionGrid_CellCount">CellCount</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a number of cells in the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a>.
This is a dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_ChildrenDistributionInfo" data-uid="C1.WPF.Schedule.AutoDistributionGrid.ChildrenDistributionInfo">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.ChildrenDistributionInfo.html#C1_WPF_Schedule_AutoDistributionGrid_ChildrenDistributionInfo">ChildrenDistributionInfo</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a collection of <a class="xref" href="C1.WPF.Schedule.DistributionInfo.html">DistributionInfo</a> objects that allows to
redefine a default placement of a certain child element.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_ChildrenFlowDirection" data-uid="C1.WPF.Schedule.AutoDistributionGrid.ChildrenFlowDirection">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.ChildrenFlowDirection.html#C1_WPF_Schedule_AutoDistributionGrid_ChildrenFlowDirection">ChildrenFlowDirection</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value that determines a flow direction of child elements
in the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a>.
The default value is <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.orientation#system-windows-controls-orientation-horizontal">Horizontal</a>.
This is a dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_ColumnCount" data-uid="C1.WPF.Schedule.AutoDistributionGrid.ColumnCount">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.ColumnCount.html#C1_WPF_Schedule_AutoDistributionGrid_ColumnCount">ColumnCount</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value that determines a number of columns in the
<a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a>. This is a dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_FitCellsOfHeight" data-uid="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfHeight">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfHeight.html#C1_WPF_Schedule_AutoDistributionGrid_FitCellsOfHeight">FitCellsOfHeight</a>
        </td>
        <td class="markdown level1 summary"><p>Allows the forcing of the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a> to generate cells
of the specified height, where a number of rows will be automatically
adjusted so as to fully fit a maximum number of cells in a current grid
height. The default value is <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double.nan">NaN</a>.
This is a dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_FitCellsOfWidth" data-uid="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfWidth">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.FitCellsOfWidth.html#C1_WPF_Schedule_AutoDistributionGrid_FitCellsOfWidth">FitCellsOfWidth</a>
        </td>
        <td class="markdown level1 summary"><p>Allows the forcing of the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a> to generate cells
of the specified width, where a number of columns will be automatically
adjusted so as to fully fit a maximum number of cells in a current grid
width. The default value is <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.double.nan">NaN</a>.
This is a dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_RowCount" data-uid="C1.WPF.Schedule.AutoDistributionGrid.RowCount">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.RowCount.html#C1_WPF_Schedule_AutoDistributionGrid_RowCount">RowCount</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value that determines a number of rows in the
<a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a>. This is a dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_VisualChildCount" data-uid="C1.WPF.Schedule.AutoDistributionGrid.VisualChildCount">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.VisualChildCount.html#C1_WPF_Schedule_AutoDistributionGrid_VisualChildCount">VisualChildCount</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a number of child elements of the <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a>.
This is a dependency property.</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_WPF_Schedule_AutoDistributionGrid_MeasureOverride_System_Windows_Size_" data-uid="C1.WPF.Schedule.AutoDistributionGrid.MeasureOverride(System.Windows.Size)">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.MeasureOverride.html#C1_WPF_Schedule_AutoDistributionGrid_MeasureOverride_System_Windows_Size_">MeasureOverride(Size)</a>
        </td>
        <td class="markdown level1 summary"><p>Measures the child elements of a <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a> in anticipation
of arranging them during the ArrangeOverride pass.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_OnRenderSizeChanged_System_Windows_SizeChangedInfo_" data-uid="C1.WPF.Schedule.AutoDistributionGrid.OnRenderSizeChanged(System.Windows.SizeChangedInfo)">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.OnRenderSizeChanged.html#C1_WPF_Schedule_AutoDistributionGrid_OnRenderSizeChanged_System_Windows_SizeChangedInfo_">OnRenderSizeChanged(SizeChangedInfo)</a>
        </td>
        <td class="markdown level1 summary"><p>Raises the SizeChanged event, using the specified information as part of the eventual event data.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Schedule_AutoDistributionGrid_OnVisualChildrenChanged_System_Windows_DependencyObject_System_Windows_DependencyObject_" data-uid="C1.WPF.Schedule.AutoDistributionGrid.OnVisualChildrenChanged(System.Windows.DependencyObject,System.Windows.DependencyObject)">
          <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.OnVisualChildrenChanged.html#C1_WPF_Schedule_AutoDistributionGrid_OnVisualChildrenChanged_System_Windows_DependencyObject_System_Windows_DependencyObject_">OnVisualChildrenChanged(DependencyObject, DependencyObject)</a>
        </td>
        <td class="markdown level1 summary"><p>Called when the visual children of a <a class="xref" href="C1.WPF.Schedule.AutoDistributionGrid.html">AutoDistributionGrid</a> element change.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
