Datagrid Inline Editing Update Failures

Tech-Archive recommends: Speed Up your PC by fixing your registry

kamstutz_at_bellsouth.net
Date: 06/19/04


Date: Sat, 19 Jun 2004 00:29:02 -0400

Would you developers have any idea under what conditions Datagrid
"onupdatecommand" routines
would fail to return the values of webcontrols via the
DataGridCommandEventArgs passed
to the routine? When browsing the "E" object argument within the locals VS
debugger window
(see sample code below) I see an error message in the Values column of the
object browser that
says "Error:cannot obtain value". Other web forms within the same
application do not demonstrate
this problem. Any suggestions as to source of this problem would be
appreciated.

Public Sub dgProducts_Update(ByVal Sender As Object, ByVal E As
DataGridCommandEventArgs)
    Dim txtProductName As TextBox = CType(E.Item.Cells(4).Controls(0),
TextBox)

    Dim strProdName As String = Convert.ToString(txtProductName.Text)