R – ASP.NET: Repeater control inside a Gridview row

asp.netgridviewrepeater

I want a Repeater control inside a Gridview row. So how can I assign the DataSource of the Repeater control so that the data it uses is that of the specific data of the GridView row?

I tried this:
DataSource='<%# Eval(Container, "DataItem.InnerVal")

but it does not work.

Best Answer

You will need to handle the GridView.RowDataBound event in your code-behind. This will allow you to dynamically create a Repeater and bind it to the data for the row you are on.