Get ItemTemplate Client

4 posts, 0 answers
  1. ken
    ken avatar
    24 posts
    Member since:
    Oct 2010

    Posted 22 Mar 2011 Link to this post

    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
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 22 Mar 2011 Link to this post

    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
  3. ken
    ken avatar
    24 posts
    Member since:
    Oct 2010

    Posted 22 Mar 2011 Link to this post

    No, I want obtain them on Client-Side.
    Thanks for quickly reply.
  4. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 23 Mar 2011 Link to this post

    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
Back to Top