I am trying to set up a scenario with nested repeaters in which I have a multiple different categories with multiple children displayed under them. The trouble is this, the parent table and child table match on category id which returns the desired results for all tables categories but this one. For some reason In this scenario I only get back textCategory1 from table A as the header text with all of children from table b in that category on the page, I checked the sp and all three are being passed.
Parent Table A
Title Text:TextCategory1|Category:13
Title Text:TextCategory2|Category:73
Title Text:TextCategory3|Category:14
Child Table B
Title Text:childText|Category:13 |Parent Category:Null
Title Text:childText|Category:74|Parent Category:2
Title Text:childText|Category:14|Parent Category:2
This is the data relation I used and I am databinding the Master repeater to the results of the first table while the child repeater is bound in the master item databound to a datarow.createchildview of the data relation.
ds.Relations.Add(new DataRelation("Category_ID", ds.Tables[0].Columns["Category_ID"],
ds.Tables[1].Columns["Category_ID"]));
MasterRep.DataSource = ds.Tables[0];
MasterRep.DataBind();
Section in MasterRep Item DataBound:
DataRowView drv = e.Item.DataItem as DataRowView;
Repeater ChildRep = e.Item.FindControl("ChildRep") as Repeater;
if (drv != null && ChildRep != null)
{
ChildRep.DataSource = drv.CreateChildView("Category_ID");
ChildRep.DataBind();
}
Can anyone suggest a reason why I would not get all three of the policy text rows from table a in this scenario?