Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Masked Input in DataGridView
Message
De
11/09/2008 08:17:40
Vijay Kumar
DNS ERP Pvt Ltd
Inde
 
 
À
11/09/2008 08:16:03
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:
01346552
Vues:
8
Rest Part

using JThomas.Controls;

create a new column and set a mask using a minimum of 4 and a maximum of 7 digits
DataGridViewMaskedTextColumn column = new DataGridViewMaskedTextColumn("0000999");
column.DataPropertyName = "Number";
column.HeaderText = "Nummer"; // German text
column.Name = "column";
column.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
column.Width = 70;

// add this column to the DataGridView dgv
dgv.Columns.Add(column);
Working by Designer
After adding the reference to the ExtendedControls.dll assembly, you can open the IDE and select a DataGridViewMaskedTextColumn as DataGridViewColumn – either in the Edit Columns window, like in the image above, or in the Add Column window. There you can set the Mask string.

Mask Details
Check all Mask possibilities in the SDK documentation for the MaskedTextBox.Mask property.
Vijay Kumar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform