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

RadComboBox Rendering Problem

1 Answer 115 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ilker
Top achievements
Rank 1
Ilker asked on 13 Oct 2016, 07:47 AM

Hi,

Can anybody help me to solve this issue?

I am using RadComboBox and have an issue about this control. I am creating RadComboBox on server side and keep this control as Html like in .png. Everthing works fine on this situation. But when I try to update items for adding or removing any item, rcbSlide in body not updated, thats why combox does not display updated items. How can sync both rcbSlide in body and radcombox div? I tried copy html from div to body but, it does not work. Also when I close and reopen project new items displayed in combo. It seems body cache the items but I can not find have can I refresh items?

Please look at attached screenshots, 

CreateRadComboBox.PNG for creating html for RadComboBox

rcbSlide_InDIV.PNG for displayed updated combo in UI

rcbSlide_InBody.PNG for html that stored in body.

 

 

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 18 Oct 2016, 06:42 AM
Hello Ilker,

I am afraid that the approach chosen to generate the RadComboBox HTML on server and simply inject it on the page is not a supported scenario for this control. Instead, you will have to add the control to the Page controls collection instead:
protected void Page_Load(object sender, EventArgs e)
{
    // Add Script manager
    var scriptManager = new RadScriptManager();
    form1.Controls.Add(scriptManager);
 
    // Add RadComboBox
    var newCombo = new RadComboBox();
    newCombo.ID = "RadComboBox1";
 
    var firstItem = new RadComboBoxItem();
    firstItem.Text = "First Item";
    newCombo.Items.Add(firstItem);
 
 
    var secondItem = new RadComboBoxItem();
    secondItem.Text = "Second Item";
    newCombo.Items.Add(secondItem);
 
    form1.Controls.Add(newCombo);
}

Then, to add or remove items, you could use the rich server-side or client-side APIs of the RadComboBox.

Regards,
Veselin Tsvetanov
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
ComboBox
Asked by
Ilker
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or