Create Dynamic RadComboBox

4 posts, 0 answers
  1. mehdi
    mehdi avatar
    4 posts
    Member since:
    Jul 2012

    Posted 21 Jul 2012 Link to this post

    Hi.
    I am Create Dynamic RadComboBox with Programing But Not Fire SelectedIndexChanged  

    RadComboBox1.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(PPLIL_SelectedIndexChanged);

     protected void PPLIL_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
             RadAjaxManager1.Alert("Hello");
        }

    Not Alert This Message Or Other Command
    Why ?
    Please Help Me
    ??
    Tanx
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Jul 2012 Link to this post

    Hi Mehdi,

    I tried to reproduce your issue but no avail. Please make sure that you are setting AutoPostBack property of RadComboBox to true. Following is the sample code.

    C#:
    RadComboBox RadComboBox1 = new RadComboBox();
    RadComboBox1.ID = "RadComboBox1";
    RadComboBox1.AutoPostBack = true;
    RadComboBoxItem item1 = new RadComboBoxItem();
    item1.Text = "item1";
    item1.Value = "item1";
    RadComboBoxItem item2 = new RadComboBoxItem();
    item2.Text = "item2";
    item2.Value = "item2";
    RadComboBoxItem item3 = new RadComboBoxItem();
    item3.Text = "item3";
    item3.Value = "item3";
    RadComboBox1.Items.Add(item1);
    RadComboBox1.Items.Add(item2);
    RadComboBox1.Items.Add(item3);
    RadComboBox1.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(RadComboBox1_SelectedIndexChanged);
    form1.Controls.Add(RadComboBox1);
     
    void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
     {
          //Your code 
     }

    Hope this helps.

    Regards,
    Princy.
  3. Konda
    Konda avatar
    3 posts
    Member since:
    Jun 2012

    Posted 08 Aug 2012 Link to this post

    Hi Princy,

    this code working fine but when i select the item in radcombobox SelectedIndexChanged not fire plz, tell me how to do that in c#.
  4. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 08 Aug 2012 Link to this post

    Hi Konda,

    Please make sure that you are setting AutoPostBack property of RadComboBox to true.

    C#:
    RadComboBox1.AutoPostBack = true;

    Please provide your full code if it doesn't helps.

    Regards,
    Princy.
Back to Top