0

I couldn't figure how to get the combo box looks like the payment method combo box from this link https://demos.telerik.com/aspnet-ajax/combobox/examples/overview/defaultcs.aspx#qsf-demo-source

The source they provide doesn't seems to have any different from each other, but I need that filled combobox design from the 4th one. Just doesn't know how to get it.

enter image description here

Jerry Lam
  • 452
  • 1
  • 7
  • 21

1 Answers1

0

If you press the View Source, then goto 'PaymentMethods.xml' you will see the method used for assigning (Xml taken directly from this Telerik Demo)

<Items>
     <Item Text="American Express" Value="1" ImageUrl="Images/card-types/american-express.png" />
     <Item Text="MasterCard" Value="2" ImageUrl="Images/card-types/mastercard.png" />
     <Item Text="Visa" Value="3" ImageUrl="Images/card-types/visa.png" />
     <Item Text="Visa Electron" Value="4" ImageUrl="Images/card-types/visa-electron.png" />
</Items>

There are other methods for adding images using the ImageUrl attribute (See this Telerik Demo)

Alternatively you might want to use the ItemTemplate should you want further control (See this Telerik Demo) This also allows you to put further details in the drop down list which is particularly useful when you want to display a little more information.

<ItemTemplate>
    <asp:Label ID="lblOptionTitle" runat="server" Text='<%# Eval('ItemTitle') %>' Font-Bold="true" />
    <asp:Label ID="lblOptionText" runat="server" Text='<%# Eval('ItemText') %>' />
    <img id="imgOption" alt="Alternative Text" src='<%# Eval('ImageUrl') %>' />
</ItemTemplate>
talegna
  • 2,407
  • 2
  • 19
  • 22