Questa è la sua firma
codice:
C#
[BrowsableAttribute(false)]
public int CurrentRowIndex { get; set; }
E come vedi è una proprietà. Al suo cambiare viene semplicemente scrollata la Grid fino a raggiungere l' item della proprietà.
Guarda questo esempio:
codice:
public void dataGrid_MouseUp(object sender,
System.Windows.Forms.MouseEventArgs e)
{
int rowIndex = dgts.DataGrid.CurrentRowIndex;
if (CustomRow != null)
{
CustomRow(this, new CustomRowEventArgs(
dataSet1,dataGrid1,rowIndex));
}
Non scatena un evento ma viene usata per selezionare una riga.
Cambia con OnClick della riga.