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

Get ItemTemplate Client

3 Answers 72 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
ken
Top achievements
Rank 1
ken asked on 22 Mar 2011, 04:38 PM
I use Table template in font of RadCombobox.
How can I get Product Name & Product Price which Product ID value had been input.
Thank
<telerik:RadComboBox ID="cboProducts" runat="server" Skin="Windows7" Font-Names ="Tahoma" Font-Size ="13px"
    Width="500px" Height="150px" CollapseDelay="0" EmptyMessage="-- Select --" CausesValidation="false" EnableLoadOnDemand="true"
    EnableItemCaching="true" ExpandDelay="0" MarkFirstMatch="true" HighlightTemplatedItems="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" ShowToggleImage="false">
<ExpandAnimation Duration="0" Type="None" />
<CollapseAnimation Duration="0" Type="None" />
    <HeaderTemplate>
    <table style="width: 500px" cellspacing="0" cellpadding="0">
        <tr>
            <td style="width: 100px;">
                Product ID</td>
            <td style="width: 330px;">
                Product Name</td>
            <td style="width: 70px;">
                Product Price</td>
        </tr>
    </table>
</HeaderTemplate>
<ItemTemplate>
    <table style="width: 465px" cellspacing="0" cellpadding="0">
  <tr>
<td style="width: 90px;">
<%# DataBinder.Eval(Container, "ProductID")%>
</td>
   <td style="width: 300px;">
<%# DataBinder.Eval(Container, "Attributes['ProductName']")%>
</td>
<td style="width: 70px;" align="right">
   <%# DataBinder.Eval(Container, "Attributes['ProductPrice']")%>
</td>
  </tr>
    </table>
</ItemTemplate>
</telerik:RadComboBox>
s

3 Answers, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 22 Mar 2011, 05:23 PM
Hi ken,

You can obtain the ProductName, ProductID and ProductPrice in the ItemDataBound event of the RadComboBox. Please take a look at this demo for an example.

Regards,
Veronica Milcheva
the Telerik team
0
ken
Top achievements
Rank 1
answered on 22 Mar 2011, 05:47 PM
No, I want obtain them on Client-Side.
Thanks for quickly reply.
0
Veronica
Telerik team
answered on 23 Mar 2011, 02:01 PM
Hi ken,

You need to add add the ProductID, ProductName and ProductPrice in Custom Attributes collection of each RadComboBoxItem and retrieve it later client-side. Please take a look at this help article for an example.

Best wishes,
Veronica Milcheva
the Telerik team
Tags
ComboBox
Asked by
ken
Top achievements
Rank 1
Answers by
Veronica
Telerik team
ken
Top achievements
Rank 1
Share this question
or