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

GridTemplateColumn

1 Answer 109 Views
Grid
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:36 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,

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Apr 2011, 06:04 AM
Hello Ron,

You can hook  OnClientLoad client-side event which occurs after the combobox has been fully initialized on the client-side. This event is helpful if you need to get the client-side instance of the combobox when it is embedded in other controls.
Here is a sample code:
aspx:
<telerik:GridTemplateColumn UniqueName="Template">
   <EditItemTemplate>
  <telerik:RadComboBox ID="RadCombo" runat="server" OnClientLoad="RadComboLoad">
              . . . . .
</telerik:RadComboBox>
   </EditItemTemplate>
</telerik:GridTemplateColumn>
Javascript:
<script type="text/javascript">
    var combo;
    function RadCombo(sender, args)
    {
       combo = sender;//save the RadCombo client object in a global variable
    }
</script>

Check out the following documentation for more on this.
OnClientLoad.

Thanks,
Shinu.
Tags
Grid
Asked by
Ron
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or