Nested Repeaters in ASP.NET
Ok so you may want to show some hierarchical data using repeaters. This means nesting a repeater in a repeater. This is fine but it takes some work in the code behind. First off create the main repeaters ItemDataBound event. In that event use the following code. I am old school so forgive me any syntax. For this code to work you must originally bind a DataSet to the parent repeater with a data relation connecting the parent/child tables. So somewhere (I do mine in page load) bind the entire dataset to the repeater: RepeaterCapabilities.DataSource = someDataSet; RepeaterCapabilities.DataBind(); Then put the following code in the repeaters ItemDataBound event protected void RepeaterCapabilities_ItemDataBound( object sender, RepeaterItemEventArgs e ) { Repeater rptActivities; DataRowView drv; // get the row behind the databind drv = e.Item.DataItem as DataRowView; if( drv != null ) { // get the nested repeater r...