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

LoadOnDemand Issue

1 Answer 92 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
shyka
Top achievements
Rank 1
shyka asked on 09 Dec 2009, 10:26 AM
im having a composite control with radcombobox inside, the radcombobox include a radgrid (but the same problem happend when i put a radtree instead of it). the problem is that when opening the combobox, theres a javascript error alert: "Script control '' is not registered script control. script control must be registered using registerscriptcontrol before..."

another problem is that when postback to ComboBox_ItemsRequested, OnPreRender is not called & i dont see the radgrid inside the drop down area of the combobox.

i suppose those three porblems are related.

here is the code:

public

 

class BOBComboBox : CompositeControl {
RadComboBox  ComboBox;
protected override void CreateChildControls()

 

 

 {

 

 

  ComboBox =

new RadComboBox();

 

 

 

 ComboBox.ItemsRequested +=

new RadComboBoxItemsRequestedEventHandler(ComboBox_ItemsRequested);

 

 

 

  ComboBox.EnableLoadOnDemand =

true;
  Controls.Add(ComboBox);

 

 

 

  base.CreateChildControls();
}

void
ComboBox_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)

 

 

 

 

 {

 

 

    RadGrid RadGrid = new RadGrid();

 

 

 

 

   RadComboBoxItem RadComboBoxItem = new RadComboBoxItem();

 

 

     RadComboBoxItem.Controls.Add(RadGrid);

     ComboBox.Items.Add(RadComboBoxItem);

 }

 

 



protected
override void OnPreRender(EventArgs e)

 

 

 

{

 

   if (ComboBox != null)

 

 

   { 

 

        RadAjaxManager manager = RadAjaxManager.GetCurrent(this.Page);

        manager.AjaxSettings.AddAjaxSetting(ComboBox, ComboBox);

   }

 

    base.OnPreRender(e);

}

}

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 11 Dec 2009, 12:05 PM
Hello shyka,

Yes, the three issues are actually one - another AJAX control cannot be put inside the drop down of Load on Demand RadComboBox. This is a limitation of RCB and the partial callback in general. Additionally the PreRender event will not fire during the Load on Demand request.

Please reconsider your design or use a Load on Demand RadTreeView / RadGrid bound on the client side.

Kind regards,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
shyka
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or