Shelley

Shelley

  • NA
  • 1
  • 0

Find Control Label in Nested Repeater

Mar 27 2008 1:49 PM

 I am using Nested Repeaters and I want to print "... Records found " OR "No Records Found" depending on rows in the nested repeater.

I am trying to calculate above in ItemBound -

 
public void OrdersItemBound(Object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item ¦¦ e.Item.ItemType == ListItemType.AlternatingItem)
{
((Repeater)e.Item.FindControl("Rep2")).DataSource = ((DataRowView)e.Item.DataItem).CreateChildView("CustOrdRel");
((Repeater)e.Item.FindControl("Rep2")).DataBind();

Repeater Rep2= (Repeater)e.Item.FindControl("Rep2") ;

int count = Rep2.Items.Count ;

// Till here I get the count value which is right .


// I need to look to the outer repeater and Find the Inner Repeater Rep2 and the label in the Inner Repeater which is in the Footer area and place - "Records Found" in it. Can somebody help me how to achieve this?

for (int p = 0 ; p < count ; p++)
{
Result1 = ((Label)(Rep2.Items[p].FindControl("ResultLabel"))) ;

// Result1.Text = "Records " ;

}