he selectedindex of my gridview is always one behind
for example, if i click on the EDIT.gif on row 1, then 5 , then 7, if i break the code and check the selectedindex, it is equal to 5. if i selected a different row, and then checked the selectedindex again, it would be equal to 7. i've checked a few posts and other people seem to have a problem with the selectedindex being one behind the current selection, anyway i'm stuck :-( here is my code
<asp:GridView ID="gvw" runat="server" AutoGenerateColumns="False" SkinID="MainList" DataKeyNames="ID">
<Columns>
<asp:TemplateField>
...
</asp:TemplateField>
<asp:TemplateField>
...
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton runat="server" ID="Editing" ImageUrl="edit.gif" AlternateText="Edit" CommandName="Editing"
CommandArgument='<%# Eval("ID") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
VB code
If e.CommandName = "Editing" Then
WriteSession(e.CommandArgument)
Response.Write(gvw.SelectedRow)
SelectedRow is always lagging one selectedindex behind the current selectedindex, any help would be great :-)