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

Create Dynamic RadComboBox

3 Answers 150 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
mehdi
Top achievements
Rank 1
mehdi asked on 21 Jul 2012, 10:16 AM
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

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Jul 2012, 07:09 AM
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.
0
Konda
Top achievements
Rank 1
answered on 08 Aug 2012, 10:14 AM
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#.
0
Princy
Top achievements
Rank 2
answered on 09 Aug 2012, 04:16 AM
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.
Tags
ComboBox
Asked by
mehdi
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Konda
Top achievements
Rank 1
Share this question
or