In asp.net (c#) I'm using a gridview and edit mode to make it easy for the user to change values. But I need to check the value that the user enter in OnRowUpdating, when using this code, I always get the old value not the new value I entered. How can I get the new value?
<asp:GridView ID="MyGridView" OnRowUpdating="MyGridViewUpdate" DataKeyNames="id,value">
<Columns>
<asp:BoundField ReadOnly="false" DataField="value" DataFormatString="{0:0.##}" />
<asp:CommandField ShowEditButton="true" EditImageUrl="~/images/iconedit.png" ButtonType="Image" CancelImageUrl="~/images/iconclose.png" UpdateImageUrl="~/images/iconedit.png" />
</Columns>
</asp:GridView>
In codebehind:
protected void MyGridViewUpdate(object sender, GridViewUpdateEventArgs e)
{
string test = e.NewValues["value"].ToString();
//Test always give the old value, I need the new value the user added..
}