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

Text not showing in Template?

3 Answers 55 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 12 Mar 2009, 06:20 AM
<telerik:RadComboBox id="RadComboBox1" runat="server" AllowCustomText="false" Skin="WebBlue" style="height: 23px;" 
 EnableTextSelection="false" HighlightTemplatedItems="false" Width="80px" Height="115px" Font-Size="11px" ForeColor="Gray" 
    > 
     
    <CollapseAnimation Duration="100" Type="InOutQuint" /> 
 
    <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> 
 
 

Could someone please assist me in getting the above code block to show the text when the dropdown is opened?


3 Answers, 1 is accepted

Sort by
0
Stephen
Top achievements
Rank 1
answered on 12 Mar 2009, 07:09 AM
Interesting, I found bit of a work around for this... If I use data binding and bind to my own collection, the templating works perfectly, of course I also had to change Container to Container.DataItem, but it worked. 

So it seems as though not using data binding seems to be the problem?

Telerik Team, what do you all think?
0
Simon
Telerik team
answered on 12 Mar 2009, 09:06 AM
Hi Stephen,

It is not necessary to bind to a data source to apply Templates. Calling DataBind on an Item will cause all of the Template's data binding expressions to be evaluated, so you need to do this.

For more information please see this help topic.

Sincerely yours,
Simon
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Stephen
Top achievements
Rank 1
answered on 12 Mar 2009, 04:44 PM
Ahah!, so thats what I was missing originally!  


Thanks for your help!
Tags
ComboBox
Asked by
Stephen
Top achievements
Rank 1
Answers by
Stephen
Top achievements
Rank 1
Simon
Telerik team
Share this question
or