I have a nested gridview that I need to sum up the values of a cell in and set a label in the parent gridview based on that sum. the below code I think should do that but gridview2 always comes back as nothing. What am I missing? Why can't I use findcontrol to find gridview2?
I tried the code in gridview1.databound and in page load and still nothing...
Dim count As Integer = 0
Dim GridView2 As GridView
Dim qtyshippedLabel As Label
For Each row As GridViewRow In GridView1.Rows
qtyshippedLabel = row.FindControl("qtyshippedLabel")
GridView2 = row.FindControl("GridView2")
If GridView2 IsNot Nothing Then
For Each r As GridViewRow In GridView2.Rows
count = count + r.Cells(0).Text
qtyshippedLabel.Text = count
count = 0