Text not showing in Template?

4 posts, 0 answers
  1. Stephen
    Stephen avatar
    70 posts
    Member since:
    Mar 2008

    Posted 12 Mar 2009 Link to this post

    <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?


  2. Stephen
    Stephen avatar
    70 posts
    Member since:
    Mar 2008

    Posted 12 Mar 2009 Link to this post

    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?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 12 Mar 2009 Link to this post

    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.
  5. Stephen
    Stephen avatar
    70 posts
    Member since:
    Mar 2008

    Posted 12 Mar 2009 Link to this post

    Ahah!, so thats what I was missing originally!  


    Thanks for your help!
Back to Top