DataGrid Focus

Discussion in 'ASP .Net' started by ABHIJIT B, Feb 18, 2008.

  1. ABHIJIT B

    ABHIJIT B Guest

    Hi,

    We are using ASP.net 2.0 with C# for developing web application.
    I am using datagrid in one of form and binding data to it as given
    below,

    if (dsDatabaseList.Tables[0].Rows.Count > 0)
    {
    dgServiceDatabaseList.DataSource =
    dsDatabaseList.Tables[0];
    dgServiceDatabaseList.DataBind();
    //dgServiceDatabaseList.SelectedIndex =
    0;
    dgServiceDatabaseList.Items[0].Cells[0].Focus();
    dgServiceDatabaseList.Cur =
    dcDatabaseListSucess = true;
    }

    dsDatabaseList.Tables[0] contains more than 100 records.

    I want to set focus on first row and first column in datagrid.

    I tried using foloowing,

    dgServiceDatabaseList.SelectedIndex = 0; but this highlights the row
    but iw ant to set focus.

    I am unaware of SetFocus() method.

    Best Regards,
    Abhijit B
    ABHIJIT B, Feb 18, 2008
    #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. Jason
    Replies:
    4
    Views:
    1,618
    Jason
    May 7, 2007
  2. Replies:
    2
    Views:
    336
    Thomas 'PointedEars' Lahn
    Jun 6, 2005
  3. Roger
    Replies:
    3
    Views:
    322
  4. Jeff

    manual focus vs. focus()

    Jeff, May 20, 2007, in forum: Javascript
    Replies:
    4
    Views:
    179
  5. Spizzat2
    Replies:
    2
    Views:
    177
    Spizzat2
    Jan 9, 2008
Loading...

Share This Page