davidrobin
Oct 14th, 2004, 08:57 AM
I have a datagird with the edit feature enabled.
When the update command is fired the text property of the textbox in the datagrid column is empty though there is text there.
I have included the EditCommand and UpdateCommand subs for you to see.
In UpdateCommand strText is always = ""
Please Help
Private Sub dgrSelected_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgrSelected.EditCommand
dgrSelected.EditItemIndex = e.Item.ItemIndex
dgrSelected.DataSource = m_dvwData
dgrSelected.DataBind()
End Sub
Private Sub dgrSelected_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgrSelected.UpdateCommand
Dim strText As String
Dim txtText As New TextBox '= CType(e.Item.Cells(4).Controls(0), TextBox)
txttext = CType(e.Item.Cells(4).Controls(0), TextBox)
strText = txtText.Text
dgrSelected.EditItemIndex = -1
dgrSelected.DataSource = m_dvwData
dgrSelected.DataBind()
End Sub
When the update command is fired the text property of the textbox in the datagrid column is empty though there is text there.
I have included the EditCommand and UpdateCommand subs for you to see.
In UpdateCommand strText is always = ""
Please Help
Private Sub dgrSelected_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgrSelected.EditCommand
dgrSelected.EditItemIndex = e.Item.ItemIndex
dgrSelected.DataSource = m_dvwData
dgrSelected.DataBind()
End Sub
Private Sub dgrSelected_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgrSelected.UpdateCommand
Dim strText As String
Dim txtText As New TextBox '= CType(e.Item.Cells(4).Controls(0), TextBox)
txttext = CType(e.Item.Cells(4).Controls(0), TextBox)
strText = txtText.Text
dgrSelected.EditItemIndex = -1
dgrSelected.DataSource = m_dvwData
dgrSelected.DataBind()
End Sub