Example #1
0
        /// <summary>
        /// Creates a copy of a DGV-MaskedTextCell containing the DGV-Cell properties.
        /// </summary>
        /// <returns>Instance of a DGV-MaskedTextCell using the Mask string.</returns>
        public override object Clone()
        {
            DataGridViewMaskedTextCell cell = base.Clone() as DataGridViewMaskedTextCell;

            cell.Mask = "00/00/0000";
            return(cell);
        }
Example #2
0
        public void ApplyCellStyleToEditingControl(
            DataGridViewCellStyle dataGridViewCellStyle)
        {
            Font = dataGridViewCellStyle.Font;
            //	get the current cell to use the specific mask string
            DataGridViewMaskedTextCell cell
                = dataGridView.CurrentCell as DataGridViewMaskedTextCell;

            if (cell != null)
            {
                Mask = cell.Mask;
            }
        }