Click here to Skip to main content
15,886,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
protected void RepeaterDetails_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
    try
    {
        foreach (Control ri in RepeaterDetails.Items)
        {
            //if (ri.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            //{
                Label lblDatatype = (Label)e.Item.FindControl("lblDatatype");
                if (lblDatatype.Text != null)
                {
                    if (lblDatatype.Text.ToLower() == "list")
                    {
                        PlaceHolder RepeaterPanel = (PlaceHolder)e.Item.FindControl("RepeaterPanel");
                        DropDownList ddl = new DropDownList();
                        ddl.Width = 150;
                        RepeaterPanel.Controls.Add(ddl);
                        i++;
                        break;
                    }
                    else
                    {
                        PlaceHolder RepeaterPanel = (PlaceHolder)e.Item.FindControl("RepeaterPanel");
                        tbx = new TextBox();
                        tbx.ID = "TextBox" + i;
                        tbx.Width = 150;
                        RepeaterPanel.Controls.Add(tbx);
                        i++;
                        break;
                    }
                }
           // }
        }
    }
    catch
    {
    }
}
Posted
Updated 25-Jul-15 19:39pm
v2
Comments
Suvendu Shekhar Giri 26-Jul-15 1:41am    
What do you want to achieve by writing this code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900