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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,738
Latest member
JinaMacvit

Latest Threads

Top