Add Items on server side

3 posts, 1 answers
  1. Sam
    Sam avatar
    27 posts
    Member since:
    Sep 2013

    Posted 09 Dec 2013 Link to this post

    Hello,

    Can anyone help me how to add items to RadDropDownList control from server side?

    I tried, but it is not working
    RadDropDownList1.Items.Add(ID + 1);

    Thanks,
    Sam
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Dec 2013 Link to this post

    Hi Sam,

    Please have a look into the following C# code to add RadDropDownList Item from server side.

    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        DropDownListItem item = new DropDownListItem();
        item.Text = "Item1";
        RadDropDownList1.Items.Add(item);
        DropDownListItem item1 = new DropDownListItem();
        item1.Text = "Item2";
        RadDropDownList1.Items.Add(item1);
    }

    Let me know if you have any concern.
    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sam
    Sam avatar
    27 posts
    Member since:
    Sep 2013

    Posted 10 Dec 2013 Link to this post

    It works.  It is binding a little differently with ASP.NET DropDownList control

    Thank you!!
Back to Top