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

List Box item with buttons

1 Answer 246 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Meera
Top achievements
Rank 1
Meera asked on 18 Jul 2016, 04:36 PM
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. 

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 21 Jul 2016, 10:07 AM
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:
<ItemTemplate>
    <span><%# DataBinder.Eval(Container, "Text")%></span>
    <asp:Button Text="Button" runat="server" ID="Button1" />
    <asp:ImageButton ImageUrl="images/MyImage.png" runat="server"  ID="Button2"/>
</ItemTemplate>

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

Regards,
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.
Tags
ListBox
Asked by
Meera
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or