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

javascript error

3 Answers 39 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 22 Apr 2011, 12:37 PM
Hi,

I'm using a radcombobox within a edititemtemplate and I would like to get the selected item on the client side but no matter which technique I use I always recieve "Object expected error" or "Microsoft JScript runtime error: radcombobox1 is undefined". I'm new
to rad controls I've spent all day on this , I must be doing something wrong. Can you help?

Thanks,

3 Answers, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 22 Apr 2011, 02:05 PM
Hi Ron,

The RadComboBox for the ASP.NET AJAX controls does not have an edittemplate. You can take a look at the demo of the control. Can you provide more information on the scenario that you have. I would also suggest that you take a look at our on-line documentation for client-side properties of the RadComboBox here.

Best wishes,
Kate
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Ron
Top achievements
Rank 1
answered on 22 Apr 2011, 03:02 PM
It's embedded in the radgrid. How would I get the selected value onclientselectedindexchanged. I really appreciate your help.

 <telerik:RadGrid ID="grdInvoiceItems" runat="server" DataSourceID="objInvoiceItems"
             Height="150px" Width="100%" AutoGenerateColumns="false" AllowAutomaticUpdates="True"
             AllowMultiRowEdit="true"  onprerender="grdInvoiceItems_PreRender" 
            <MasterTableView DataKeyNames="Id" EditMode="InPlace"  AutoGenerateColumns="False" >
                <Columns>
                <%--<telerik:GridEditCommandColumn ButtonType="ImageButton">
                    <HeaderStyle Width="100px" />
                </telerik:GridEditCommandColumn> --%>
                <telerik:GridBoundColumn DataField="Id" HeaderText="Id" Visible="false">
                </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn HeaderText="Items" DataField="Items" UniqueName="Items"  EditFormColumnIndex="1">
                        <EditItemTemplate>                   
                                 <telerik:RadComboBox ID="ddlItems" runat="server" DataSourceID="objItems" 
                                    AutoPostBack="true" DataTextField="Items"  DataValueField="Description"  Width="100px" Height="75"
                                      onselectedindexchanged="ddlItems_SelectedIndexChanged">
                                         <Items>
                                            <telerik:RadComboBoxItem Text="Select Item" Value="Select Item" ></telerik:RadComboBoxItem>
                                        </Items>
                            </telerik:RadComboBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
0
Shinu
Top achievements
Rank 2
answered on 25 Apr 2011, 12:49 PM
Hello Ron,

RadComboBox provides a flexible client-side API. You can easily interact with the combobox in the browser using the combobox client-side object.You can attach the OnClientSelectedIndexChanged event to the RadComboBox and access the selectedItem. Here is a sample code.

JavaScript:
<script type="text/javascript">
    function OnClientSelectedIndexChanged(sender, args)
    {
        alert(sender.get_selectedItem().get_text());
    }
</script>

aspx:
<EditItemTemplate>
  <telerik:RadComboBox ID="ddlItems" runat="server" AutoPostBack="true" Width="100px"
     Height="75" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged". . . . . . .>               
   </telerik:RadComboBox>
</EditItemTemplate>

RadComboBox Object

Thanks,
Shinu.
Tags
ComboBox
Asked by
Ron
Top achievements
Rank 1
Answers by
Kate
Telerik team
Ron
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or