mcgarry101 0 Newbie Poster

Hi,

after spending days on this I hope someone can help me. I am using one gridview nested inside another, and I need to reference on of the columns in the adult gridview when updating the child gridview. Make any sense??

I have a footer row in the child which I am using for adding a new row to this child grid. To post to my DB (oracle), I need the a category_code field which is held in the first column of the adult grid, along with all those fields found in the child footer.

How on earth do I reference this field in the adult grid!!!
I have included my code below. As you can see from the code the field strcat_code is the one i need to retrieve from the adult gridview.

If anyone can help me with this I will be forever grateful! Please bear in mind though that i am new to .net development so please be gentle....

David.

Protected Sub GridView2_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)
        If e.CommandName = "AddBudget" Then

            Dim gvTemp As GridView = CType(sender, GridView)
            gvUniqueID = gvTemp.UniqueID

            'Get the values stored in the text boxes
            Dim strBuapNo As String = buap_no
            'Dim strCat_code As String = gvTemp.DataKeys(1).Value.ToString()
            'Dim strCat_Code As String = GridView1.DataKeys(0).Value.ToString()
            'Dim strCat_code As String = GridView1.Rows(gvTemp.SelectedIndex).Cells(0).Text
            'Dim strCat_code As String = (CType(GridView1.FindControl("lblCode"), Label)).Text
            Dim strSeqNo As String = 0
            Dim strPayeeName As String = (CType(gvTemp.FooterRow.FindControl("txtPayeeName"), TextBox)).Text
            Dim strSortCode As String = (CType(gvTemp.FooterRow.FindControl("txtSortCode"), TextBox)).Text
            Dim strBankAccNo As String = (CType(gvTemp.FooterRow.FindControl("txtBankAccNo"), TextBox)).Text
            Dim dblAmt As Double = (CType(gvTemp.FooterRow.FindControl("txtPayAmt"), TextBox)).Text
            Dim strPayFreq As String = (CType(gvTemp.FooterRow.FindControl("ddPayFreq"), DropDownList)).SelectedValue
            Dim intMonDue As String = (CType(gvTemp.FooterRow.FindControl("ddMonDue"), DropDownList)).SelectedValue
    End Sub