954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

begging for help with a nested gridview

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.


[code]
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
[code]

mcgarry101
Newbie Poster
19 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You