DataGrid problem with tabindex

Discussion in 'ASP .Net Web Controls' started by mac, Apr 16, 2005.

  1. mac

    mac Guest

    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.
    mac, Apr 16, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ravikanth[MVP]

    TabIndex of DataGrids

    Ravikanth[MVP], Jul 18, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    343
    Deidre
    Jul 21, 2003
  2. kai

    Tabindex

    kai, Jan 9, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,006
  3. Natty Gur
    Replies:
    1
    Views:
    1,889
    Marshal Antony
    Mar 3, 2004
  4. samira455
    Replies:
    0
    Views:
    1,049
    samira455
    Sep 12, 2006
  5. Delinx32

    DHTML TabIndex Problem with <SELECT>

    Delinx32, Jul 16, 2004, in forum: Javascript
    Replies:
    0
    Views:
    155
    Delinx32
    Jul 16, 2004
Loading...

Share This Page