title: bind data to repeater inside a gridview
body: <p>Hi have a repeater which is inside a gridview. when i bind the data to gridview the data is binding to the controles inside the gridview but repeater is not binding.</p>
  
  <pre><code>&lt;asp:GridView ID="gvMain" runat="server" AllowPaging="false" AutoGenerateColumns="false"
            Width="200px" Height="200px" 
      onrowdatabound="gvMain_RowDataBound"&gt;
          &lt;Columns&gt;
              &lt;asp:TemplateField&gt;
                  &lt;ItemTemplate&gt;
                      &lt;asp:LinkButton ID="lbtnDptName" runat="server" Text='&lt;%# Eval("deptName")%&gt;'&gt;&lt;/asp:LinkButton&gt;
                      &lt;asp:Label ID="lblDptDesc" runat="server" Text = "sdfsdfsdfdsf"&gt;&lt;/asp:Label&gt;
                      &lt;asp:Repeater ID="rtFunctions" runat="server" OnItemDataBound="rtFunctions_ItemDataBound" &gt;
                          &lt;HeaderTemplate&gt;
                              &lt;table&gt;
                          &lt;/HeaderTemplate&gt;
                          &lt;ItemTemplate&gt;
                              &lt;tr&gt;
                                  &lt;td&gt;
                                      &lt;asp:LinkButton ID="lbtnFunctions" runat="server" &gt;&lt;/asp:LinkButton&gt;
                                      &lt;asp:Label ID="lbltemp" Style="border:1px solid blue;width:20px;height:20px;background:green" runat="server" Text="TempLabel" &gt;&lt;/asp:Label&gt;
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/ItemTemplate&gt;
                          &lt;FooterTemplate&gt;
                              &lt;/table&gt;
                          &lt;/FooterTemplate&gt;
                      &lt;/asp:Repeater&gt;
  
                  &lt;/ItemTemplate&gt;
              &lt;/asp:TemplateField&gt;
          &lt;/Columns&gt;
      &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>in Page load:</p>
  
  <pre><code>gvMain.DataSource = objDeptColl;
                      gvMain.DataBind();
  </code></pre>
  
  <p>Codebehind for repeater:</p>
  
  <pre><code>protected void gvMain_RowDataBound(object sender, GridViewRowEventArgs e)
          {
              FunctionCollection objTempFuncColl = new FunctionCollection();
              objTempFuncColl = (FunctionCollection)Cache["objFuncColl"];
              Repeater rt = (Repeater)e.Row.FindControl("rtFunctions");
  
              if (e.Row.RowType == DataControlRowType.DataRow &amp;&amp; objTempFuncColl.Count !=0 )
              {
                  rt.DataSource = objTempFuncColl;
                  rt.DataBind();
              }
          }
          protected void rtFunctions_ItemDataBound(object sender, RepeaterItemEventArgs e)
      {
          FunctionCollection objTempFuncColl = new FunctionCollection();
          objTempFuncColl = (FunctionCollection)Cache["objFuncColl"];
          Repeater rt = (Repeater)e.Item.FindControl("rtFunctions");
          if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
          {
              foreach (Functions f in objTempFuncColl)
              {
                  LinkButton lnk = (LinkButton)e.Item.FindControl("lbtnFunctions");
                  lnk.Text = f.funcName;
              }
          }
      }
  </code></pre>
  
  <p>linkbutton in gridview is binding but the linkbutton in repeater is not binding.</p>