 ---------------------------------------------------
|                                                   |
| Mask Edit                                         |
|                                                   |
| iGrid.NET 6.0 Extra Samples                       |
| Copyright (c) 10Tec Company                       |
| All rights reserved                               |
|                                                   |
| Environment: .NET Framework 4.0, VS2010-VS2017    |
|                                                   |
 ---------------------------------------------------

Description:
============
The source code of this sample is an example of how to implement sophisticated mask input in iGrid cells.

Short Code Explanation:
=======================
This sample demonstrates how to implement date input according to the mask MM/dd/yyyy, which is created from the characters available in .NET custom format strings.

The main work is done in the handlers of the RequestEdit and TextBoxKeyPress events of iGrid. The RequestEdit event handler is used to process the pressed character when iGrid is in browse mode and enable editing if the character is allowed by the input mask. The TextBoxKeyPress event handler checks every pressed character while iGrid is in edit mode and replaces the characters in the cell text directly if they are allowed by the input mask.

The implemented approach is intelligent enough. First, it allows the user to enter only the digits that generates a correct date if we evaluate the whole cell text, and the range of available digits depends on the character position. For example, it is impossible to enter November 31st ("11/31/...") while October 31 is allowed ("10/31/..."). Second, if the user has filled the two digits of the month or day section, the following separator character ("/") is skipped automatically so the user enters only required digits. This all is possible due to the rich set of iGrid members that provide a granular control over its constituent parts.
