DataGrid Focus

A

ABHIJIT B

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top