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

Error adding items manually

1 Answer 36 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Marcel
Top achievements
Rank 1
Marcel asked on 20 Dec 2012, 10:59 AM
Hi there,

I am struggling to insert items to the RadComboBox.

I use the following code

protected

 

void cbLocation_DataBound(object sender, EventArgs e)

{

//fill radcombobox

cbLocation.Items.Clear();

cbLocation.Items.Insert(0,

new RadComboBoxItem("<Make choice>", ""));

cbLocation.Items.Insert(1,

new RadComboBoxItem("EPO", "EPO"));

cbLocation.Items.Insert(2,

new RadComboBoxItem("PDC", "PDC"));

}

I get the following error when I click the Update or Cancel button in the Edit form:
Error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

Do you have any idea why the error occurs?

Thanx!

Marcel

1 Answer, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 20 Dec 2012, 08:30 PM
Hello Marcel,

Are you updating this control using ajax? If so, is this control not ajaxified by a RadAjaxPanel or RadAjaxManager or UpdatePanel? If not, you will need to in order to modify it using ajax.

Also, I would advise adding the items in the RadComboBox's load event, rather than the DataBound event.

I hope that helps.
Tags
ComboBox
Asked by
Marcel
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Share this question
or