Hello,
I have not been able to locate a solution to my problem, so thought I'd post it here.
I have created a class that extends the RCB (i.e public class MyComboBox : Telerik.Web.UI.RadComboBox { ...}). Code omitted though it does do a fair bit of company centric implementation.
I have placed two of these controls on a page, one dynamically loading items the other statically. I have no issues with the dynamically loaded CB, Including the extended functionality, all works great.
Though the statically loaded CB does not render the items, everything else seems fine!
Statically loaded:
This displays an empty ComboBox.
Page code:
<cc1:MyComboBox ID="dl2" TabIndex="7" BackColor="White" Width="72px" runat="server" |
Font-Size="12px" Font-Names="Arial" CssClass="txtBox"> |
<Items> |
<telerik:RadComboBoxItem Selected="True" Value="N/A"></telerik:RadComboBoxItem> |
<telerik:RadComboBoxItem Value="Male" Text="Male"></telerik:RadComboBoxItem> |
<telerik:RadComboBoxItem Value="Female" Text="Female"></telerik:RadComboBoxItem> |
</Items> |
</cc1:MyComboBox> |
Dynamically loaded:
This is fine, the items are added in the code behind
<cc1:MyComboBox ID="dl1" TabIndex="1" BackColor="White" Width="160px" runat="server" |
Font-Size="12px" Font-Names="Arial"> |
</cc1:MyComboBox> |
I have tried a simple extensions of the RadComboBoxItemCollection and RadComboBoxItem hoping that would help, but it did not.
public class MyComboBoxItem : RadComboBoxItem |
{ |
public MyComboBoxItem() |
{ |
} |
} |
public class MyComboBoxItemCollection : RadComboBoxItemCollection |
{ |
public MyComboBoxItemCollection():base(null) |
{ |
} |
public MyComboBoxItemCollection(Control parent):base(parent) |
{ |
} |
} |
<cc1:MyComboBox ID="dl2" TabIndex="7" BackColor="White" Width="72px" runat="server" |
Font-Size="12px" Font-Names="Arial" CssClass="txtBox"> |
<Items> |
<cc1:MyComboBoxItem Selected="True" Value="N/A"></cc1:MyComboBoxItem> |
<cc1:MyComboBoxItem Value="Male" Text="Male"></cc1:MyComboBoxItem> |
<cc1:MyComboBoxItem Value="Female" Text="Female"></cc1:MyComboBoxItem> |
</Items> |
</cc1:MyComboBox> |
I have a feeling I am missing one vital but simple requirement, though cannot for the life of me see what it is.
Any help would be appreciated.
Cheers.