Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Masked Input in DataGridView
Message
De
11/09/2008 08:22:13
Vijay Kumar
DNS ERP Pvt Ltd
Inde
 
 
À
11/09/2008 08:17:40
Vijay Kumar
DNS ERP Pvt Ltd
Inde
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01345274
Message ID:
01346554
Vues:
10
Rest part

How It Works
As shown in Microsoft's example, we have to define three classes.

DataGridViewMaskedTextColumn
This class is derived from DataGridViewColumn in the same way as the original DataGridViewTextBoxColumn class. We must implement our own derivation because the MaxInputLength property is not valid in MaskedTextBox instances. It contains the standard constructor and another constructor setting the Mask string directly:

use the Bitmap of MaskedTextBox
System.Drawing.ToolboxBitmap(typeof(System.Windows.Forms.MaskedTextBox))]
public class DataGridViewMaskedTextColumn : DataGridViewColumn
//{
public DataGridViewMaskedTextColumn() : this(String.Empty) {}

public DataGridViewMaskedTextColumn(string maskString)
: base(new DataGridViewMaskedTextCell())
// {
SortMode = DataGridViewColumnSortMode.Automatic;
Mask = maskString;
// }
Vijay Kumar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform