Update Event not getting new values
<p>Im having trouble with my update command. It finds the textbox controls but it doesn't get the new values entered into it and i can't figure out why. i've done some tutorials and im not getting far. In my Update event is a class called Pages which updates the text and that works if i add the text values manually. The problem is accessing the newly updated text from my textboxes.</p>

<pre><code>    &lt;asp:GridView ID="CustomGridView1" runat="server" AutoGenerateColumns="false" DataKeyNames="Name" AutoGenerateSelectButton="true"
    ShowHeaderWhenEmpty="True" ShowFooter="true" AutoGenerateEditButton="true" OnDataBound="CustomGridView_DataBound"
    OnRowEditing="CustomGridView_CancelEditCommand" OnRowCommand="CustomGridView1_RowCommand" 
    OnLoad="CustomGridView1_Load" OnRowUpdated="CustomGridView1_RowUpdated" OnRowUpdating="CustomGridView1_RowUpdating" OnRowCancelingEdit="CustomGridView1_RowCancelingEdit"
     ShowHeader="true"&gt;
            &lt;Columns&gt;
        &lt;asp:TemplateField HeaderText="Page Name" HeaderStyle-HorizontalAlign="Left"&gt;
            &lt;ItemTemplate&gt;
                &lt;%# Eval("Name") %&gt;
            &lt;/ItemTemplate&gt;
            &lt;EditItemTemplate&gt;
                &lt;asp:TextBox ID="Name" runat="server" Text='&lt;%# Bind("Name") %&gt;'&gt;&lt;/asp:TextBox&gt;
            &lt;/EditItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="Path" HeaderStyle-HorizontalAlign="Left"&gt;
            &lt;ItemTemplate&gt;
                &lt;%# Eval("Path") %&gt;
            &lt;/ItemTemplate&gt;
            &lt;EditItemTemplate&gt;                    
                &lt;asp:TextBox ID="Path" runat="server" Text='&lt;%# Bind("Path") %&gt;'&gt;&lt;/asp:TextBox&gt;
            &lt;/EditItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="Route Value" HeaderStyle-HorizontalAlign="Left"&gt;
            &lt;ItemTemplate&gt;
                &lt;%# Eval("RouteValue") %&gt;
            &lt;/ItemTemplate&gt;
            &lt;EditItemTemplate&gt;
                &lt;asp:TextBox ID="RouteValue" runat="server" Text='&lt;%# Bind("RouteValue") %&gt;'&gt;&lt;/asp:TextBox&gt;
            &lt;/EditItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
        &lt;asp:TemplateField HeaderText="RegExp" HeaderStyle-HorizontalAlign="Left"&gt;
            &lt;ItemTemplate&gt;
                &lt;%# Eval("RegExp") %&gt;
            &lt;/ItemTemplate&gt;
            &lt;EditItemTemplate&gt;
                &lt;asp:TextBox ID="RegExp" runat="server" Text='&lt;%# Bind("RegExp") %&gt;'&gt;&lt;/asp:TextBox&gt;
            &lt;/EditItemTemplate&gt;
        &lt;/asp:TemplateField&gt;
    &lt;/Columns&gt;        
&lt;/asp:GridView&gt;
</code></pre>

<p>This part here isn't firing i prefere the method RowUpdated Method in the answer is there a reason why my Updated Event is not firing</p>

<pre><code>protected void CustomGridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{
    if (e.Exception == null &amp;&amp; e.AffectedRows == 1)
    {
        Pages pages = new Pages();
        SystemPage SySPage = new SystemPage();
        SySPage.Name = e.NewValues[0].ToString();
        SySPage.Path = e.NewValues[1].ToString();
        SySPage.RouteValue = e.NewValues[2].ToString();
        SySPage.RegExp = e.NewValues[3].ToString();
        pages.Update(SySPage, xmlFile);

        CustomGridView1.EditIndex = -1;
        BindData();
    }

}

protected void CustomGridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{

    for (int i = 0; i &lt; CustomGridView1.Columns.Count - 1; i++)
    {
        DataControlFieldCell cell = CustomGridView1.Rows[CustomGridView1.EditIndex].Cells[i] as DataControlFieldCell;
        CustomGridView1.Columns[i].ExtractValuesFromCell(e.Keys, cell, DataControlRowState.Edit, false);
    }

    Pages pages = new Pages();
    SystemPage SysPage = new SystemPage();
    SysPage.Name = e.NewValues[0].ToString();
    SysPage.Path = e.NewValues[1].ToString();
    SysPage.RouteValue = e.NewValues[2].ToString();
    SysPage.RegExp = e.NewValues[3].ToString();
    pages.Update(SysPage, xmlFile);

    lblInsert.Text = e.NewValues[3].ToString();

    CustomGridView1.EditIndex = -1;
    BindData();
}
</code></pre>
