title: Finding controls in nested listviews
body: <p>I'm building a collapsible grouping grid using Matt Berseth's example from 
  <a href="http://mattberseth.com/blog/2008/01/building_a_grouping_grid_with.html" rel="nofollow noreferrer">mattberseth.com/blog/2008/01/building_a_grouping_grid_with.html
  </a></p>
  
  <p>It has an inner listview "lvInner" nested in an outer listview "lvOuter".
    I'm trying to access a textbox in lv_Inner using</p>
  
  <pre><code>Protected Sub lvInner_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ListViewItemEventArgs) Handles lvInner.ItemDataBound
  
      If e.Item.ItemType = ListViewItemType.DataItem Then
  
       Dim tb As TextBox = TryCast(e.Item.FindControl("lvOuter").FindControl("lvInner").FindControl("TextBox1"), TextBox)
             ' Do something to TextBox1
  
       End If
  EndSub
  </code></pre>
  
  <p>I get an "Object reference not set to an instance of an object" error on line  Dim tb.</p>