-1
<Telerik:RadComboBox ID="ddlInvoiceNumber" CssClass="feilds" runat="server" AutoPostBack="false"
    OnClientDropDownClosed="onDropDownClosed" EmptyMessage="-- Select Invoice --"
    LoadingMessage="Please wait" CheckBoxes="true" AppendDataBoundItems="true" SkinID="Windows7"
    Width="450" HighlightTemplatedItems="true">
    <HeaderTemplate>
        <table style="width: 420px;" cellspacing="0" cellpadding="0">
            <tr>
                <td style="width: 180px; float: left">
                    Invoice
                </td>
                <td style="width: 60px; float: left">
                    Value
                </td>
                <td style="width: 60px; float: left">
                    Balance
                </td>
                <td style="width: 60px; float: right">
                    Requested
                </td>
            </tr>
        </table>
    </HeaderTemplate>
    <ItemTemplate>
        <table style="width: 420px;" cellspacing="0" cellpadding="0">
            <tr>
                <td style="width: 180px; float: left" class="smalltext">
                    <%#DataBinder.Eval(Container, "Text")%>
                </td>
                <td style="width: 60px; float: left" class="smalltext">
                    <%#DataBinder.Eval(Container, "Value")%>
                </td>
                <td style="width: 60px; float: left" class="smalltext">
                    <%#Eval("BalanceAmount")%>
                </td>
                <td style="width: 60px; float: right" class="smalltext">
                    <asp:TextBox ID="txtDDLInvoiceAmount" runat="server" Text='<%#Eval("BalanceAmount")%>'
                        Width="58px"></asp:TextBox>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</Telerik:RadComboBox>

Javascript function on onDropDownClosed

  function onDropDownClosed(sender, eventArgs) {

      for (var i = 0; i < Length; i++) {
          document.getElementById('<%= lblInvoiceNumberDisplay.ClientID %>').innerHTML += sender.get_checkedItems()[i].get_text() + ", ";
          sum += parseFloat(sender.get_checkedItems()[i].get_value(), 10);

          // Here i want checked textbox values 
      }
  }

Please help - how do I FindControl a TextBox inside a ComboBox item template on the client side?

Jon Grant
  • 11,369
  • 2
  • 37
  • 58
Syed Umar Ahmed
  • 5,612
  • 1
  • 21
  • 23

1 Answers1

0

I am answering to my own question

The findControl expects the ID of the control, but it returns the client object that is found with that ID, e.g. internally it uses $find() method to get the javascript object. The hidden fields do not have such client objects and that is why it cannot find it. You can use this approach to get the DOM element:

$telerik.findElement(sender.get_items().getItem(0).get_element(), "txtDDLInvoiceAmount").value
Syed Umar Ahmed
  • 5,612
  • 1
  • 21
  • 23