DataGrid problem with tabindex

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I need to use keyboard to navigate through rows in datagrid(like ms excel)
and upon hitting enter the row should be selected.
I have this datagrid in a user control which is used on page at design time.
And smartNavigation is set to true on the page.

I have two problems

1. When ever there is postback when the row is selected, tabindex is lost
and upon hitting tab,the focus goes to address bar of IE browser.I would like
to have focus on the row selected, so that clicking tab goes to next row.

2. Clicking tab navigates through the rows and hitting enter postbacks fine.
But when i add one more button control, upon clicking enter on the row,
select command is not fired and button control does the postback. Is there
any way i can limit this.

I have button column for selection which is hidden. So i added
templatedcolumn as first column which has label control. In Item_Databound
event, i am setting tabindex to label. I am adding attribute to row for e.g
row.attribute.add("onkeydown","javascript:trapKeys"); This function traps the
enter key and does the postback as if it is selecting the row.
.



Relevant Pages

  • Re: asp:DropDownList and Javascript
    ... disable JavaScript in my browser, ... than firing immediately after a new selection is made. ... Is there any way to determine which control initiated the PostBack? ...
    (microsoft.public.dotnet.languages.csharp)
  • Mobile Controls: SelectionList
    ... I'm totally new to mobile web development so this may be a really stupid ... fill a second Selection with items from a database. ... Only two HTML form elements cause form postback. ... If your custom control renders an HTML element that does not cause postback ...
    (microsoft.public.vstudio.development)
  • Radio button selection and a data grid
    ... Is it possible w/ASP.Net to set the property of the radio button control to ... 'read-only' after the user has made their selection before hitting an ... when they select 'Accept' in say the second row that the other rows ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: FormView DropdownList - On Selection Change populate Text Box
    ... expecting it to cause a postback when you change the selection, ... set the AutoPostback property= true in the properties for this control. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: posting radiobuttons inside a gridview do not persist selection after postback..
    ... I already have the enableviewstate set to ... and the problem is that in this snippet, the control variable comes null. ... I would like the selection to ... action makes the postback. ...
    (microsoft.public.dotnet.framework.aspnet)