Hi,
I have on page RadComboBox with ItemTemplate:
and I have javascript function
which fire when OnClientSelectedIndexChanged fired.
How get value TextBox of current Item?
var txt = item.findControl("txtContinentId");
is not find textbox!
I have on page RadComboBox with ItemTemplate:
<telerik:RadComboBox ID="ddlDestination" runat="server" DataSourceID="dsDestination" DataTextField="country" DataValueField="countryID" OnClientSelectedIndexChanged="ChangeItem"> |
<ItemTemplate> |
<%#Eval("country") %> |
<asp:TextBox ID="txtContinentId" runat="server" Visible="false" Text='<%# Eval("continentID")%>'></asp:TextBox> |
</ItemTemplate> |
<CollapseAnimation Duration="200" Type="OutQuint" /> |
</telerik:RadComboBox> |
and I have javascript function
<script language="javascript" type="text/javascript"> |
function ChangeItem(sender, eventArgs) |
{ |
var item = eventArgs.get_item(); |
var txt = item.findControl("txtContinentId"); |
alert (txt); |
fmAreaCenter(item.get_value()); |
} |
</script> |
which fire when OnClientSelectedIndexChanged fired.
How get value TextBox of current Item?
var txt = item.findControl("txtContinentId");
is not find textbox!
7 Answers, 1 is accepted
0
Hi Evgeniy,
Please use the following javascript code to find the textbox in RadComboBox item template:
Note that the textbox should be visible.
Regards,
Yana
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Please use the following javascript code to find the textbox in RadComboBox item template:
function ChangeItem(sender, eventArgs) |
{ |
var item = eventArgs.get_item(); |
var txt = item.get_element().children[0]; |
alert(txt); |
} |
Note that the textbox should be visible.
Regards,
Yana
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Evgeniy
Top achievements
Rank 1
answered on 16 Oct 2008, 02:33 PM
Thank you very much!!!
But my TextBox have visible=false!!!!!!!
that to do me?
Help me please.
Thanks!
But my TextBox have visible=false!!!!!!!
that to do me?
Help me please.
Thanks!
0
Hi Evgeniy,
Server controls which have their Visible property set to false are not rendered at all. This means that you cannot get them on the client-side.
Regards,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Server controls which have their Visible property set to false are not rendered at all. This means that you cannot get them on the client-side.
Regards,
Albert
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Evgeniy
Top achievements
Rank 1
answered on 16 Oct 2008, 02:56 PM
Thank you!
I have a following problem:
My RadComboBox binding with SqlDataSource.
In SqlDataSource i have 3 column: ContinentId, CountryId, CountryName.
In RadComboBox:
DataTextField = CountryName
DataValueField = CountryId
But I need to store ContinentId in RadComboBox too.
Can I make it?
I have a following problem:
My RadComboBox binding with SqlDataSource.
In SqlDataSource i have 3 column: ContinentId, CountryId, CountryName.
In RadComboBox:
DataTextField = CountryName
DataValueField = CountryId
But I need to store ContinentId in RadComboBox too.
Can I make it?
0
Hi Evgeniy,
You need to use CustomAttributes and ItemDataBound event.
I hope this will get you started.
Regards,
Veselin Vasilev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
You need to use CustomAttributes and ItemDataBound event.
I hope this will get you started.
Regards,
Veselin Vasilev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Datamex
Top achievements
Rank 2
answered on 26 Sep 2009, 12:39 PM
Hi,
The solution you gave :
Only seems to work in internet explorer and not in firefox.
Is there a way to get the item also in firefox?
The solution you gave :
function ChangeItem(sender, eventArgs) |
{ |
var item = eventArgs.get_item(); |
var txt = item.get_element().children[0]; |
alert(txt); |
} |
Only seems to work in internet explorer and not in firefox.
Is there a way to get the item also in firefox?
0
Hi Datamex,
I'm sorry it should be like this:
All the best,
Yana
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I'm sorry it should be like this:
function DoOnClientNodeExpanded(sender, eventArgs) { |
eventArgs.get_node().select(); |
CollapseOthers(eventArgs.get_node()); |
return true; |
} |
All the best,
Yana
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.