Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Masked Input in DataGridView
Message
From
11/09/2008 08:17:40
Vijay Kumar
DNS ERP Pvt Ltd
India
 
 
To
11/09/2008 08:16:03
Vijay Kumar
DNS ERP Pvt Ltd
India
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01345274
Message ID:
01346552
Views:
7
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform