Hello
I set enableCustomText
and onpageload I set to focus() the combobox text.
I need some help to make is hightlight all current text like in
textbox.selectall()
with the focus() the cursor is in the most left and user need to press delete before can enter new text.
I set enableCustomText
and onpageload I set to focus() the combobox text.
I need some help to make is hightlight all current text like in
textbox.selectall()
with the focus() the cursor is in the most left and user need to press delete before can enter new text.
4 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 16 Apr 2009, 07:13 AM
Hi,
You can try out the following code to set the focus on the combobox as well as to select the current text in the combo:
aspx:
js:
Thanks
Princy.
You can try out the following code to set the focus on the combobox as well as to select the current text in the combo:
aspx:
| <telerik:RadComboBox ID="RadComboBox1" runat="server" DataSourceID="SqlDataSource1" DataTextField="Role" |
| DataValueField="Role" AllowCustomText="true" Text="Select-Item"> |
| </telerik:RadComboBox> |
js:
| function pageLoad() |
| { |
| var comboBox = $find("<%=RadComboBox1.ClientID %>"); |
| var input = comboBox.get_inputDomElement(); |
| input.focus(); |
| comboBox.selectText(); |
| } |
Thanks
Princy.
0
Ifdev02
Top achievements
Rank 1
answered on 16 Apr 2009, 05:53 PM
hello
for
RadComboBox1.ClientID
I get control not declared. It is likely becasue I place control inside the toolbar.
for
RadComboBox1.ClientID
I get control not declared. It is likely becasue I place control inside the toolbar.
| <telerik:RadToolBarButton runat="server"> |
| <ItemTemplate> |
| <telerik:RadComboBox ID="Box1" |
0
Accepted
Princy
Top achievements
Rank 2
answered on 17 Apr 2009, 05:40 AM
Hello,
Give a try with the following code and see whether its working fine.
aspx:
js:
Thanks,
Princy.
Give a try with the following code and see whether its working fine.
aspx:
| <telerik:radtoolbar id="RadToolBar1" runat="server"> |
| <Items> |
| <telerik:RadToolBarButton runat="server" Text="Button 0"> |
| <ItemTemplate> |
| <telerik:radcombobox id="Box1" AllowCustomText="true" runat="server"> |
| <Items> |
| <telerik:RadComboBoxItem runat="server" Text="Item1" Value="Item1"></telerik:RadComboBoxItem> |
| <telerik:RadComboBoxItem runat="server" Text="Item2" Value="Item2"></telerik:RadComboBoxItem> |
| </Items> |
| </telerik:radcombobox> |
| </ItemTemplate> |
| </telerik:RadToolBarButton> . . . |
| </Items> |
| </telerik:radtoolbar> |
js:
| <script type="text/javascript"> |
| function pageLoad() |
| { |
| var toolBar = $find("<%=RadToolBar1.ClientID %>"); |
| var item = toolBar.findItemByText('Button 0'); |
| var combo = item.findControl('Box1'); |
| var input = combo.get_inputDomElement(); |
| input.focus(); |
| combo.selectText(); |
| } |
| </script> |
Thanks,
Princy.
0
Ifdev02
Top achievements
Rank 1
answered on 18 Apr 2009, 04:10 PM
This perfect.
I wonder how could one learn to solve such mistery.
By the way, I don't even know how to search the word "$Find" google. I think google doenst like $
I wonder how could one learn to solve such mistery.
By the way, I don't even know how to search the word "$Find" google. I think google doenst like $