*Wipes off spiderweb*
*Cleans blog*
Damn this blog is isolated. I almost drown in spiderwebs. Spiderman must've been here. HAHA
Anyways, something to remind myself on programming.
How to Simulate Cell Keypress in a Datagridview? (VB.NET 2005)
1. Make sure EVERY COLUMN is set to ReadOnly = True.
- This is so it would not enter edit mode on each cell when you press a key.
- When a cell is selected, you can find out the current column by using DataGridView1.CurrentCell.ColumnIndex
- When you use KeyPress, it will run
DataGridView1_KeyPress
- DataGridView1.CurrentCell.Value = e.KeyChar
That way, you can use KeyPress, and get the values of the character keyed in and do the necessary checking if any.












