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

Problem with comobox inside the ModalPopupExtender

2 Answers 61 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jessy Joseph
Top achievements
Rank 1
Jessy Joseph asked on 07 May 2010, 08:56 PM
I have the following code in the ModalPopup Panel. The problem is that I can see checkbox but no item on the side. If I remove the checkbox control then the items are visible. Is it a bug or do I have to include anything else in my code.

 

 

 

<asp:Panel ID="pn1" runat="server" CssClass="popup" Width="1200px" Style="display: none;"> <div class="body"><telerik:RadComboBox runat="server" ID="RadComboBox1" ZIndex="10000000" HighlightTemplatedItems="true">

<Items>

<telerik:RadComboBoxItem Text="One" Value="One" />

<telerik:RadComboBoxItem Text="Two" Value="Two" />

<telerik:RadComboBoxItem Text="Three" Value="Three" />

</Items>

<ItemTemplate>

<asp:CheckBox runat="server" ID="CheckBox" onclick="stopPropagation(event);" Text="" />

 

<%

# DataBinder.Eval(Container, "Text") %> </ItemTemplate> </telerik:RadComboBox> </div> </asp:Panel>

 

 

 

 

Thanks.

 

 

 

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 10 May 2010, 11:24 AM
Hello Jessy Joseph,

Have you set the following on Page_Load in code-behind:

RadComboBox1.DataBind();

DataBinder.Eval expressions work only when the RadComboBox is in a bound mode. In other words, you should explicitly call the DataBind() method even if no datasource is set to the RadComboBox.

In addition I offer you to set the DataBinder.Eval() expression directly in the Text of the RadComboBox like this:

<asp:CheckBox runat="server" ID="CheckBox" onclick="stopPropagation(event);" Text='<%# DataBinder.Eval(Container, "Text") %>' />

This way your code will be more clear. No need of using empty string for the Text.

Hope this helps.

All the best,
Veronica Milcheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jessy Joseph
Top achievements
Rank 1
answered on 10 May 2010, 03:31 PM
Thanks a lot Veronica, it worked like magic :)
Tags
ComboBox
Asked by
Jessy Joseph
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Jessy Joseph
Top achievements
Rank 1
Share this question
or