8 Answers, 1 is accepted
Please find below a sample code snippet that shows the needed approach.
ASPX:
<form id="form1" runat="server"> |
<asp:ScriptManager ID="ScriptManager1" runat="server"> |
</asp:ScriptManager> |
<telerik:RadComboBox ID="RadComboBox1" runat="server" Text=" " AllowCustomText="true" Width="300px"> |
<Items> |
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" /> |
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" /> |
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3" /> |
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem4" /> |
</Items> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
<ExpandAnimation Type="OutQuart" /> |
<ItemTemplate> |
<asp:TextBox ID="TextBox1" runat="server" Width="280px"></asp:TextBox> |
</ItemTemplate> |
</telerik:RadComboBox> |
</form> |
Code-behind:
protected void Page_Load(object sender, EventArgs e) |
{ |
foreach(RadComboBoxItem myItem in RadComboBox1.Items) |
{ |
TextBox myBox = (TextBox)myItem.FindControl("TextBox1"); |
myBox.Text = "This is" + " " + myItem.Text; |
} |
} |
Kind regards,
Paul
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Help me angain...
pum
Please find below a sample code snippet that shows the needed approach on the client.
<form id="form1" runat="server"> |
<asp:ScriptManager ID="ScriptManager1" runat="server"> |
</asp:ScriptManager> |
<script type="text/javascript"> |
function GetValue() |
{ |
var myTBox = $get('<%= ((TextBox)RadComboBox1.FindItemByText("RadComboBoxItem3").FindControl("TextBox1")).ClientID %>'); |
alert(myTBox.value); |
} |
</script> |
<telerik:RadComboBox ID="RadComboBox1" runat="server" Text=" " AllowCustomText="true" Width="300px"> |
<Items> |
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" /> |
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" /> |
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3" /> |
<telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem4" /> |
</Items> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
<ExpandAnimation Type="OutQuart" /> |
<ItemTemplate> |
<asp:TextBox ID="TextBox1" runat="server" Width="280px"></asp:TextBox> |
</ItemTemplate> |
</telerik:RadComboBox> |
<input id="Button1" type="button" value="button" onclick="GetValue()" /> |
</form> |
Kind regards,
Paul
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

I use code below but error "Object reference not set to an instance of an object."
help me!!!
pum
function
OnClientSelectedIndexChanged(sender, eventArgs)
{
var myTBox = $get('<%= ((HiddenField)cboEditVersion.FindControl("hEdit")).ClientID %>');
alert(myTBox.value);
}
</
script>
<
telerik:RadComboBox ID="cboEditVersion" runat="server" Skin="Outlook" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged"
Width="200px" MarkFirstMatch="true" EnableLoadOnDemand="true"
HighlightTemplatedItems="true" ItemRequestTimeout="500" OnItemDataBound="cboEditVersion_ItemDataBound" >
<HeaderTemplate>
<table style="width: 100%; text-align: left">
<tr>
<td style="width: 60px;">Date</td>
<td style="width: 120px;">User</td>
<td style="width: 0px;"></td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table style="width: 100%; text-align: left">
<tr>
<td style="width: 60px;"><%# DataBinder.Eval(Container.DataItem, "Date") %></td>
<td style="width: 120px;"><%# DataBinder.Eval(Container.DataItem, "User") %></td>
<td style="width: 0px;"><asp:HiddenField ID="hEdit" Value='<%# DataBinder.Eval(Container.DataItem, "Version") %>' runat="server" /></td>
</tr>
</table>
</ItemTemplate>
<CollapseAnimation Duration="200" Type="OutQuint" />
<ExpandAnimation Type="OutQuart" />
</telerik:RadComboBox>
Here's your modified JS function that works as expected.
<script type="text/javascript"> |
function OnClientSelectedIndexChanged(sender, eventArgs) |
{ |
var myTBox = $get('<%= ((HiddenField)cboEditVersion.SelectedItem.FindControl("hEdit")).ClientID %>'); |
alert(myTBox.value); |
} |
</script> |
Kind regards,
Paul
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

I don't know reason error but my RadCombobox live in user control .
I believe that the best way to proceed would be if you open a new support ticket and send us a sample project where the problem can be reproduced and we will check it right away.
Kind regards,
Paul
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

pum