Hi,
I have a Repeater inside a FormView in my page.I am creating a RadComboBox control programmatically and adding it to the Repeater.
protected
void DynamicFieldsRepeater_PreRender(object sender, EventArgs e)
{
Repeater
repeater = (Repeater)sender;
RadComboBox
comboBox = new RadComboBox();
comboBox.ID =
"combo";
comboBox.DataSourceID =
"ObjectDataSource2";
comboBox.DataTextField =
"Name";
comboBox.DataValueField =
"Id";
repeater.Controls.Add(comboBox);
//DropDownList d = new DropDownList();
//d.ID = "dropdown";
//d.DataSourceID =
"ObjectDataSource2";
//d.DataTextField = "Name";
//d.DataValueField = "Id";
// repeater.Controls.Add(dropdown);
}
When I run the page I get this java script error:
'addEventListener' is null on not an object.
The thing is when I use DropDownList instead of RadComboBox,it works fine without error.
I am able to add RadDatePicker,RadTextBox,RadNumerticTextBox without the error, but not RadComboBox.
I am facing the same error when I use PlaceHolder instead of Repeater and try to add RadComboBox to to the placeholder programmatically.
Just to mention that I tried adding the controls in IntemCreated event of the repeater and the same error happend.
Thanks for your help.
Sima