Instead of trying to figure out the row index of the button, just use the CommandArgument property in addition to the GridView event bubbling. Then you can go to your datasource for all you want to know about the record in question.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" OnRowCommand="GridView1_RowCommand">
<Columns>
<asp:BoundField HeaderText="name" DataField="name"/>
<asp:TemplateField>
<ItemTemplate>
<asp:Button id="Button1" runat="server" Text="View" CommandName="MyView" CommandArgument='<%#Eval("id") %>'/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
and in code behind
protected void GridView1_RowCommand(Object sender, GridViewCommandEventArgs e)
{
String id = e.CommandArgument.ToString();
if (e.CommandName == "View")
{
}
}