all groups > asp.net datagrid control > november 2005 >
You're in the

asp.net datagrid control

group:

What is the Equivalent of the CurrentRowIndex Property for a DataGrid Web Control?


What is the Equivalent of the CurrentRowIndex Property for a DataGrid Web Control? .NETn00b
11/26/2005 11:46:05 AM
asp.net datagrid control: What is the equivalent of CurrentRowIndex for the DataGrid control in
ASP.NET?

I am trying to convert the following windows app method, to use in an
ASP.NET application:

private void DataGrid1_CurrentCellChanged(object sender, EventArgs e)
{

int c = DataGrid1.CurrentRowIndex;
DataGrid1.Select(c);
DataGrid1_Click( sender, e);

}

The problem is that there is no CurrentRowIndex property for the
DataGrid web control. Is there something else I can use, that will give
me similar functionality?

I also need to figure out what I can use in place of the Select method,
which also doesn't exist for the DataGrid web control. Would
SelectedIndex work? Can this method be adapted?

Thanks!!!

--
Sent via .NET Newsgroups
Re: What is the Equivalent of the CurrentRowIndex Property for a DataGrid Web Control? Elton Wang
11/26/2005 10:33:09 PM
You can use
datagrid.SelectedIndex

or in some events, such as ItemDataBound, ItemCommand

use e.Item.ItemIndex

HTH


[quoted text, click to view]

AddThis Social Bookmark Button