I am using a data grid to display some information. One column I wish to set as a numeric only column. This would be the "requested" column. How can I make sure that the user can only enter numeric keystrokes in this column? My other question deals with the "priority" column. I have it as a drop down combo but I wish to populate it with two values, "Routine" and "Stat". How can I populate the column and then let the user select? I would like it to default to Routine.
Here is my code so far. Thanks in advance for your help.
Shannan
DataGridView1.Columns.Add("Name", "Name")
DataGridView1.Columns.Add("OnHand", "On Hand")
DataGridView1.Columns.Add("Requested", "Requested")
Dim prioritycolumn As New DataGridViewColumn
prioritycolumn = New DataGridViewComboBoxColumn()
DataGridView1.Columns.Add(prioritycolumn)
With DataGridView1.Columns.Item(3)
.Name = "Priority"
.HeaderText = "Priority"
.Width = 165
End With
DataGridView1.Columns(0).ReadOnly = True
DataGridView1.Columns(1).ReadOnly = True
DataGridView1.Rows.Add("Widget", 1, 0)
DataGridView1.Rows.Add("I.V.", 3, 0)
DataGridView1.Rows.Add("Needle", 2, 0)
Here is my code so far. Thanks in advance for your help.
Shannan
DataGridView1.Columns.Add("Name", "Name")
DataGridView1.Columns.Add("OnHand", "On Hand")
DataGridView1.Columns.Add("Requested", "Requested")
Dim prioritycolumn As New DataGridViewColumn
prioritycolumn = New DataGridViewComboBoxColumn()
DataGridView1.Columns.Add(prioritycolumn)
With DataGridView1.Columns.Item(3)
.Name = "Priority"
.HeaderText = "Priority"
.Width = 165
End With
DataGridView1.Columns(0).ReadOnly = True
DataGridView1.Columns(1).ReadOnly = True
DataGridView1.Rows.Add("Widget", 1, 0)
DataGridView1.Rows.Add("I.V.", 3, 0)
DataGridView1.Rows.Add("Needle", 2, 0)