DataGridTextBoxColumn Bug

  • Thread starter Thread starter Adam Deane
  • Start date Start date
A

Adam Deane

I have a Datagrid bound to a dataset.
The Grid uses a DataGridTextBoxColumn style.
If I click on a cell, then enter a single character,then
click in a cell above or below it, the character I typed
is deleted and the cell reverts back to its original
value!

What should I do ?
 
Adam:

The usual cause is that it's bound to a dataset and the value entered isn't
acceptable. ie typing 1 into a DateTime field. If it was read-only, you
wouldn't even be able to change it. Anyway, if that's not the problem, post
the code and I'll see what I can do. Here's a copy of the code I use and it
works fine:

dg.SuspendLayout()

Dim tsMain As New DataGridTableStyle

tsMain.MappingName = AllData.Tbl_Job_Tracking.TableName

'Work Type Column

Dim csWorkType As DataGridTextBoxColumn = New DataGridTextBoxColumn

csWorkType.MappingName = AllData.Tbl_Job_Tracking.Columns(0).ColumnName

csWorkType.HeaderText = "Work Type"

csWorkType.Width = 70

tsMain.GridColumnStyles.Add(csWorkType)

dg.TableStyles.Add(tsMain)

dg.ResumeLayout()
 
Back
Top