Cannot enter minus sign from Numeric Key Pad in a DataGridTextBoxColumn - If you create a Windows Form with a DataGrid control with text box columns you will not be able to type in the minus sign key from the numeric key pad. Learn how to overcome this problem.
The LBTT Spot
"Lifeline is focused on developing and marketing systems designed to assist in the early detection of breast and ovarian cancer."



Cannot enter minus sign from Numeric Key Pad in a DataGridTextBoxColumn

View C# Source Code

Article Categories:

.Net Framework
.Net Framework 1.1
ADO.NET
ASP.NET
Assemblies
Asynchronous Methods
C#
Collections
Configuration
Delegates
Events
Pocket PC
Regular Expressions
Smart Devices
SQL Server
Visual C#
Visual Studio .NET
Visual Studio .NET 2003
Windows Forms
XML

C# .Net Fun Menu

View Current Page's ASP.NET Source Code
C# Reference
C# Study Flash Cards
Valuable Links
Contact Us
Site Map
Mike's Portfolio

C# Reference Search:

Full Text Search:

Articles by Author:

Code Examples (zipped):

Cannot enter minus sign from Numeric Key Pad in a DataGridTextBoxColumn

If you create a Windows Form with a DataGrid control with text box columns you will not be able to type in the minus sign key from the numeric key pad. Learn how to overcome this problem.
Category: Windows Forms, Visual Studio .NET, Posted 1/2/2003, By Mike G.

In order to fix this problem you must defined a 'TableStyle' then 'GridColumnStyle' columns for the style for your DataSource then set the 'Multiline' property of the inherent TextBox control to 'true': // first find out the name of the DataGridTextBoxColumn control then do something like this // in your Form's Loading event handler: private void frmRundown_Dates_Load(object sender, System.EventArgs e) { // other Loading event code .... dataGridTextBoxColumnDummyControl.TextBox.Multiline = true; } And that's all there is too it! You can now press the minus sign key in the numeric key pad and it will be added to the text successfully.