List Box item with buttons

2 posts, 0 answers
  1. Meera
    Meera avatar
    14 posts
    Member since:
    Mar 2012

    Posted 18 Jul 2016 Link to this post

    Is it possible to add a button control to the list box item?  I was able to add images to each item, but i want to make these images to button icons. 
  2. Ivan Danchev
    Ivan Danchev avatar
    2132 posts

    Posted 21 Jul 2016 Link to this post

    Hello Meera,

    You can place HTML elements and controls (Button, ImageButton, etc.) in the ListBox' ItemTemplate, for example if you use the following template the ListBox items will display text, an asp:Button and an ImageButton next to it:
        <span><%# DataBinder.Eval(Container, "Text")%></span>
        <asp:Button Text="Button" runat="server" ID="Button1" />
        <asp:ImageButton ImageUrl="images/MyImage.png" runat="server"  ID="Button2"/>

    You can find more information about the ListBox templates in the respective section of the documentation.

    Ivan Danchev
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top