# GrapeCity.Win.Spread.InputMan.CellType.GcDateTimeCellType.ValidateMode

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Win_Spread_InputMan_CellType_GcDateTimeCellType_ValidateMode_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.GcDateTimeCellType.ValidateMode*">ValidateMode Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Win_Spread_InputMan_CellType_GcDateTimeCellType_ValidateMode_" data-uid="GrapeCity.Win.Spread.InputMan.CellType.GcDateTimeCellType.ValidateMode*"></a>
<h4 id="GrapeCity_Win_Spread_InputMan_CellType_GcDateTimeCellType_ValidateMode" data-uid="GrapeCity.Win.Spread.InputMan.CellType.GcDateTimeCellType.ValidateMode">ValidateMode</h4>
<div class="markdown level1 summary"><p>Gets or sets the validation mode during control input.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ValidateModeEx ValidateMode { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Property ValidateMode As ValidateModeEx</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="GrapeCity.Win.Spread.InputMan.CellType.ValidateModeEx.html">ValidateModeEx</a></td>
      <td><p>One of the <a class="xref" href="GrapeCity.Win.Spread.InputMan.CellType.ValidateModeEx.html">ValidateModeEx</a> enumeration values.  The default
is <a class="xref" href="GrapeCity.Win.Spread.InputMan.CellType.ValidateModeEx.html#GrapeCity_Win_Spread_InputMan_CellType_ValidateModeEx_ValidateEx">ValidateEx</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_Win_Spread_InputMan_CellType_GcDateTimeCellType_ValidateMode_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>
      If the <b>ValidateMode</b> property is set to <a class="xref" href="GrapeCity.Win.Spread.InputMan.CellType.ValidateModeEx.html#GrapeCity_Win_Spread_InputMan_CellType_ValidateModeEx_ValidateEx">ValidateEx</a>,
      the control performs strict validation such as checking for leap-years and non-existing
      date values.  Also, automatic character filtering and field adjustments are made as the
      user enters data. For example, in the case of leap years, when the input mask is set to
      'yyyy.MM.dd', the user will not be able to enter February 29th, 2003. If the input mask
      is set to 'dd.MM.yyyy', entering February 29th, 2003 will automatically adjust the 29th
      to the 28th as soon as the last 3 is entered for the year.
    </p>
<p>
      If this property is set to ValidateModeEx.Validate, the control
      performs loose validation which causes all fields to behave independently.
      For example, if the input mask is set to 'yyyy.MM.dd', the control allows
      you to enter a date such as February 31st, 2003 which normally does not exist as a date-time
      value.  The following table shows the valid range for the fields when ValidateModeEx.Validate is used.
    </p>
<table><thead><tr><th class="term">Fields</th><th class="description">Valid Range</th></tr></thead><tbody><tr><td class="term">yyyy</td><td class="description">1 - 9999</td></tr><tr><td class="term">yy</td><td class="description">0 - 99</td></tr><tr><td class="term">ee</td><td class="description">1 - 99</td></tr><tr><td class="term">MM</td><td class="description">1 - 12</td></tr><tr><td class="term">dd</td><td class="description">1 - 31</td></tr><tr><td class="term">HH</td><td class="description">0 - 23</td></tr><tr><td class="term">mm</td><td class="description">0 - 59</td></tr><tr><td class="term">ss</td><td class="description">0 - 59</td></tr></tbody></table>
<p>
      If this property is set to <span class="xref">ValidateModeEx</span>, the
      control does not perform any validation.  The fields behave independently just as
      when set to <span class="xref">ValidateModeEx.Validate</span>.  For example, if the
      input mask is set to 'yyyy.MM.dd', the control allows you to enter '0000.00.00' which
      is not a date-time value.  The following table shows the valid range for
      the fields when <span class="xref">ValidateModeEx</span> is used:
    </p>
<table><thead><tr><th class="term">Fields</th><th class="description">Valid Range</th></tr></thead><tbody><tr><td class="term">yyyy</td><td class="description">0 - 9999</td></tr><tr><td class="term">yy</td><td class="description">0 - 99</td></tr><tr><td class="term">ee</td><td class="description">0 - 99</td></tr><tr><td class="term">MM</td><td class="description">0 - 99</td></tr><tr><td class="term">dd</td><td class="description">0 - 99</td></tr><tr><td class="term">HH</td><td class="description">0 - 99</td></tr><tr><td class="term">mm</td><td class="description">0 - 99</td></tr><tr><td class="term">ss</td><td class="description">0 - 99</td></tr></tbody></table>
<p>
      This property only takes effect when entering data within the control.  The date-time value
      is validated as soon as focus leaves the control.
    </p>
<p>
      During input, if the entered data is incomplete such as '2003.__.01', or a non date-time
      value such as '2002.02.31' is entered, the <span class="xref">GrapeCity.Win.Spread.InputMan.CellType.GcDateTime.Value</span>
      property returns null.
    </p>
<div class="NOTE"><h5>cnotes</h5><p>
      Performing spin actions causes date-time values to carry on in any mode of the
    <b>ValidateMode</b> property.  The valid range for the spin actions is equivalent
      to when entering data as shown in the tables above.
    </p></div>
</div>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.invalidenumargumentexception">InvalidEnumArgumentException</a></td>
      <td><p>A value that is not within the range of valid values for the enumeration was assigned to
the property.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
