Programmatcially add ItemTemplate item

2 posts, 0 answers
  1. James Shelton-Agar
    James Shelton-Agar avatar
    108 posts
    Member since:
    May 2008

    Posted 24 Sep 2009 Link to this post

    Hi there, just to avoid confusion, I am not asking about adding ItemTemplate in run time.

    At moment, we can add normal radcombobox items with .items.add, how can we do equivalent for itemtemplate items? If we don't rebind it everytime anything new.

    Searched for posts and get no result, pls help, thanks
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Sep 2009 Link to this post

    Hi James,

    I guess you want to add dynamically created control to RadComboBox's ItemTemplate control from code behind. I tried following code which adds a new control to RadComboBox Item, that is similar to adding ItemTemplate control. Hope this helps.

    protected void Button1_Click(object sender, EventArgs e) 
        foreach( RadComboBoxItem item in RadComboBox1.Items ) 
            TextBox TextBox1 = new TextBox(); 

    Note: The documentation shows how to add ItemTemplate at runtime: Adding Templates

Back to Top