This is a migrated thread and some comments may be shown as answers.

asp:Repeater inside a GridTemplateColumn

1 Answer 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tree
Top achievements
Rank 1
Tree asked on 02 Feb 2008, 09:13 PM
I want to display a list of items in a grid cell.  So I have set up a GridTemplateColumn in which I'd like to have an asp:Repeater which in turn would have an ItemTemplate with a Literal or Label for the items to be listed.

For this to work I'll need to set up the datasource for the repeater on each grid row.  I expect that I need to handle an event whenever a row is being added to the grid and set the datasource but don't know how to do that. 

I have no idea how to access the gridtemplateitem programatically to do that nor how to hook into the appropriate grid row event.

Can someone help?

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 04 Feb 2008, 08:06 AM
Hello Eriksson,

You can use ItemCreated or ItemDataBound to populate the Repeater. Here is an example:

if(e.Item is GridDataItem)
{
    Repeater Repeater1 = (Repeater)e.Item.FindControl("Repeater1");
    Repeater1.DataSource = MySource;
}

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Tree
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or