I am using the AspxGridView with Enable Edit, Inserting and Delete set and use the gridview's popup edit mode set to modal. When the popup comes up I will click in the first edit field and enter it's value and then tab key through the remaining fields to enter each other fields value. Then you can tab to the Update or Cancel links to finish. The problem is you can tab past the Cancel and it starts tabbing through the browser address bar, menus, search field, browser window tab and finally back to first field in popup. Also, when the popup first come sup, no field has focus, so I tried hitting tab and the focus goes off to somewhere else in browser.
I saw you mentioned setting tabindex to - 1 for popup in this posting, http://www.devexpress.com/Support/Center/p/Q354207.aspx?searchtext=aspxgridview+modal+tab but that seems to be for a separate popup control from the grid and I have not found a setting for that yet in the gridview's properties.
I have even performed this on your Demo grid edit popup when set to modal and on your login popup for users to post questions.
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Carl,
Thank you for contacting us.
ASPxGridView does not allow you to set this setting for the built-in Popup Edit Form. We will try to find a workaround for this issue, but we need additional time for this. We will contact you when we have any results.
Best regards,
Vladimir
Hello Carl,
As I understand your task, you want prevent focusing the browser address bar, menu and other browsers functional elements.
This task isn't feasible out of the html page. If you change the element tabIndex, you can prevent focusing inputs only.
Thanks,
Ruslan
I want to prevent the TAB KEY from tabbing out of the modal popup edit from the AspxGridView when a user already has the focus in it. If a user clicks with the mouse in address bar or hits ALT-D, so be it, that's more purposeful than accidentally hitting TAB key one too many times.
The link I provided shows that your regular AspxPopUpControl has the ability to control this TAB key feature.
Is there a way to capture to do the TabIndex on the PopUp Edit for the gridview, or capture and stop the Tab going past Cancel link or Shift Tab going past the first field, or the if it is Element TabIndex you mentioned where do I set it?
Hi Carl,
Thank you for your response. As a workaround you need to subscribe to the KeyPress client-side event. You can do it in the ASPxGridView.CellEditorInitialize event handler as shown below:
Protected Sub ASPxGridView1_CellEditorInitialize(ByVal sender As Object, ByVal e As ASPxGridViewEditorEventArgs) Dim tb As ASPxTextBox = TryCast(e.Editor, ASPxTextBox) tb.ClientSideEvents.KeyPress = "OnKeyPress" End Sub
function OnKeyPress(s, e) { if(e.htmlEvent.keyCode == 9) { //execute the required code ASPxClientUtils.PreventEventAndBubble(e.htmlEvent); } }
Thanks,
Nikolai
OK, so you gave me code to kill the tab key from working at all when I asked for the user to be able to use the tab key and only stop them from tabbing past the 'Cancel' link or shift+tab in the first aspxedit. The other issue, the TAB key disabled in Firefox but continued to work in IE8, including leaving the popupedit and entering the Address, Menu, Tabs, etc.
The removal of the TAB key usage is poor from workflow usage perspective, if a person is entering data from the keyboard they should be able to TAB to next field instead of having to leave and grab the mouse.
I do feel you are either not really reading or not understanding the issue here and just throwing out random answers in hopes that they work. I didn't ask for them to not be able to tab WITHIN the popup, I asked for them to not tab OUT of the popup, just like your AspxPopupControl link I've included earlier in this issue.
Also you marked your code sample C#, you might want to check that. Makes a person question more how much the quality of attention to what is being done to make sure something is tested and works before posting as an answer.
Hi Carl,
Thank you for your feedback. I apologize for not being clear. To solve the problem, you need to add a standard input to the EditForm template. Handle the onfocus event. In this event, set focus to the first editor in your edit form. Please note that you need to specify ClientInstanceName to the first editor in the ASPxGridView.CellEditorInitialize event handler.
I have created a sample project that demonstrates how you can accomplish this task. See the attachment.
Thanks,
Nikolai
That's working in IE and FF, thanks.
What is the reason a PopupEdit from a EditForm Template using the ASPxGridViewTemplateReplacement changes how the tab key functions within the popup?
Hi Carl,
You are welcome.
The last question is not quite clear to me. If you use ASPxPopupControl and place text boxes in it, you will get the same behavior as in case of the ASPxGridView popup edit form. This is standard browser behavior. When you set focus to the last element in the page hierarchy after pressing the Tab key, focus will be moved to the browser's address bar.
Thanks,
Nikolai