I am attempting to use some code that I found in this forum to update the DataGrid's DataSource when a cell changes, but the row does not change.
Here is the code.
However, tbc.TextBox.Modified is always False, so I am never hitting the code. Am I supposed to set the Modified property at some point, or should it be set automatically?
Thanks for your help,
Andrea
Here is the code.
Code:
Private Sub TextBoxValidating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs)
Dim tbc As DataGridTextBoxColumn = _
CType(dg.TableStyles(0).GridColumnStyles
(dg.CurrentCell.ColumnNumber), DataGridTextBoxColumn)
If Not tbc.TextBox Is Nothing AndAlso tbc.TextBox.Modified Then
Dim bm As BindingManagerBase = _
dg.BindingContext(dg.DataSource, dg.DataMember)
CType(bm.Current, DataRowView).Row.Item(tbc.MappingName) = _
tbc.TextBox.Text
End If
End Sub
However, tbc.TextBox.Modified is always False, so I am never hitting the code. Am I supposed to set the Modified property at some point, or should it be set automatically?
Thanks for your help,
Andrea