1

All. I have a datagridview with Columns. I need to be able to add blank rows to an already populated grid. I have 10 textboxes in place along with a button "ADD." Upon the button click event it should add the blank row to the datagridview, however, it is not functioning properly. I'm not getting an error of any kind, and my code seems to be OK. Please and thank you for help in advance.

Here is My Code Behind. Default.aspx.vb

Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView1.SelectedIndexChanged
End Sub

Protected Sub Operations_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) _
Handles Operations.RowCommand
Insert data if the CommandName == "Insert"
and the validation controls indicate valid data...
    If e.CommandName = "Insert" AndAlso Page.IsValid Then
        Insert(New record)
        SQLDATASOURCE1.Insert()
    End If
End Sub


Protected Sub SQLDATASOURCE1_Inserting _
(sender As Object, e As .ObjectDataSourceMethodEventArgs) _
Handles SQLDATASOURCE1.Inserting
    Dim OPN_NUMBER As TextBox = _
    Operations.FooterRow.FindControl("OPN_NUMBER")
    Dim OPN_Desc As TextBox = _
    Operations.FooterRow.FindControl("OPN_DESC")
    Dim OPN_GL_ACCT As Textbox = _
    Operations.FooterRow.FindControl("OPN_GL_ACCT")
    Dim OPN_COST_CENTER As TextBox = _
    Operations.FooterRow.FindControl("OPN_COST_CENTER")
    Dim OPN_IND_LABOR As TextBox = _
    Operations.FooterRow.FindControl("OPN_IND_LABOR")
    Dim OPN_DIR_LABOR As TextBox = _
    Operations.FooterRow.FindControl("OPN_DIR_LABOR")
    Dim OPN_Non_OT As TextBox = _
    Operations.FooterRow.FindControl("OPN_NON_OT")
Dim OPN_STATUS As TextBox =_
    Operations.FooterRow.FindControl("OPN_STATUS")
    Dim OPN_UPDATED As TextBox = _
    Operations.FooterRow.FindControl("OPN_UPDATED")
    Dim OPN_UPDATED_BY As TextBox = _
    Operations.FooterRow.FindControl("OPN_UPDATED_BY")

End Sub
JTroy
  • 7
  • 3

0 Answers0