Find Gridviewrow from Event Controls

C#

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList ddl = (DropDownList)sender;
GridViewRow row = (GridViewRow)ddl.Parent.Parent;
int idx = row.RowIndex;
}

Vb

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)

    Dim ddl As DropDownList = DirectCast(sender, DropDownList)

    Dim row As GridViewRow = DirectCast(ddl.Parent.Parent, GridViewRow)

    Dim idx As Integer = row.RowIndex

End Sub