Problems using Focus() method on a webcontrol

Discussion in 'ASP .Net Web Controls' started by RBM007, Nov 2, 2006.

  1. RBM007

    RBM007 Guest

    Hello,

    I have created webpages in the atlas standard. To help my users, I
    automaticaly focus to the first editable control which is in a GridView
    kind control.
    Every gridview is placed in a UpdatePanel which is recently translated
    from Atlas to AJAX. Before the translation everything works perfectly,
    but after the translation I got problems with calling focus.

    Here some code:
    DropDownList first = null;
    if (myGridView.EditIndex == -1)
    {
    first =
    ((DropDownList)myGridView.FooterRow.FindControl("ControlNameEditTemplate"));
    }
    else
    {
    first =
    ((DropDownList)myGridView.Rows[ExGrid1.EditIndex].FindControl("ControlNameFooter"));
    }
    first.Focus();

    This code is placed (and called) upon databinding of the grid, but it
    only works when the page is first loaded. Does anyone know how I can
    fix this error? Thanks in advantage.

    Greetings,

    René Beltman
     
    RBM007, Nov 2, 2006
    #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. Guest
    Replies:
    2
    Views:
    737
  2. RBM007
    Replies:
    0
    Views:
    296
    RBM007
    Nov 2, 2006
  3. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    203
    Luis Ramírez
    Jul 6, 2004
  4. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    195
    Kasabaarde Sumta
    Dec 13, 2004
  5. Roger
    Replies:
    3
    Views:
    338
Loading...

Share This Page