
|
Cannot enter minus sign from Numeric Key Pad in a DataGridTextBoxColumn
|
|---|
|
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.
|
|