Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1685
Setting focus to grid in usercontrol
posted

I have a grid in a user control where its not possible to set the grid to be the first tab index.

Whats the best way to programatically set the focus to the grid?
Should it just be .Focus() ?
Will this make the grid have an active row?

I presume I can't set the focus in OnLoad as not everything is visible yet.
Theres no Activated for usercontrols.

Parents
No Data
Reply
  • 1803
    posted

    Hi jaa,

    Definetly you can set the Active Row in the Load event provided the grid is provided with datasource...(Runtime or Desingntme)

    if ur providing the datasource at designtime.. then it will be ready before the load event,, so u can set it  

    best part wud be if ur providing a datasource at runtime  ,immediate next line of code check for the row count and set the activerow to row(0) index.

    hope this helps you ..

    hppy Koding,

    Arun

     

     

     

     

     

     

Children