| <asp:UpdatePanel ID="upPartner" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false"> |
| <ContentTemplate> |
| <table id="tblMain" runat="server" style="width: 100%;" cellpadding="0" cellspacing="0"> |
| ... |
| <tr> |
| <td style="width: 75%;"> |
| <telerik:RadComboBox ID="comboName" runat="server" AllowCustomText="true" Width="75%" |
| AutoPostBack="true" Skin="Vista" OnSelectedIndexChanged="comboName_SelectedIndexChanged"> |
| <ItemTemplate> |
| <asp:Label ID="lblItemText" runat="server" CssClass="StandardInput"></asp:Label> |
| </ItemTemplate> |
| </telerik:RadComboBox> |
| </td> |
| </tr> |
| ... |
| </ContentTemplate> |
| </asp:UpdatePanel> |
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);
}
}