ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
asp.net MVC grid inline edit select value in text box and put focus on it after edit button clicked
Title:
B
I
{code}
?
Hi I need to select a value ("select all" command for text-box ) and put focus on a text-box after edit button click in asp.net MVC grid. the text-box is part of a grid row. Below is code I have: @(Html.Awe().Grid("GridPersistent") .Mod(o => o.InlineEdit(Url.Action("Create"), Url.Action("Edit"))) ... new Column { Bind = "Number", Header = "Suggested <br /> Number" }.Mod(o => o.Inline(Html.Awe().TextBox("Number"))), new Column { ClientFormat = AwesomeMvcDemo.Utils.GridUtils.InlineEditFormat(), Width = 60 }, So a value for Number text-box needs to be selected and in focus. I am using latest version of grid control for .net 4.5. Please help me.
Save Changes
Cancel
ross
asked at 09 Jan 2017
by default the first textbox (tabbable) is focused when you click the edit button, so that already works, to select the text inside the textbox you can handle the `aweinlineedit` event on the row, so it could be like this: $(document).on('aweinlineedit', function(e){ var row = $(e.target); row.find("input:text:first").focus().select(); });
at 09 Jan 2017
Omu
Answers
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK