GridView row not updating, text from trxtbox in gridview edit template not coming
<p>I have grid view in which I want to update row but it is not happening. The datasource is a DataTable. Please help.</p>

<p><br>Below is the markup</p>

<pre><code>&lt;asp:GridView ID="GrdV" runat="server" AutoGenerateColumns="false"   
   OnRowEditing="GrdV_RowEditing"  OnRowUpdating="GrdV_RowUpdating"&gt;

 &lt;Columns&gt;
   &lt;asp:TemplateField HeaderText="Clip Description"&gt;
        &lt;ItemTemplate&gt;
            &lt;asp:Label ID="lblDescrptn" runat="server" Text='&lt;%# Bind("Description") %&gt;'&gt;
            &lt;/asp:Label&gt;
        &lt;/ItemTemplate&gt;
        &lt;EditItemTemplate&gt;
            &lt;asp:TextBox ID="descTbx" runat="server" Text='&lt;%# Bind("Description") %&gt;'&gt;
            &lt;/asp:TextBox&gt;
        &lt;/EditItemTemplate&gt;
    &lt;/asp:TemplateField&gt;

   &lt;asp:CommandField ShowEditButton="True" /&gt;

 &lt;/Columns&gt;
</code></pre>

<p>and this is code behind</p>

<pre><code>    protected void GrdV_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {

        // Retrieve the row being edited.
      int index = GrdV.EditIndex;
        GridViewRow row = GrdV.Rows[index];           
        TextBox t1 = row.FindControl("descTbx") as TextBox;

        DataTable dt = (DataTable)Session["tmdataTable"];

        dt.Rows[index]["Description"] = t1.Text; //Description is a column of my DataTable
        dt.AcceptChanges();
        GrdV.EditIndex = -1;
        GrdV.DataSource = dt;
        GrdV.DataBind();

    }
</code></pre>

<p>On debugging , I find that textbox is passing empty string <code>t1.Text =""</code> even after I have filled textbox with new values.
I think the error is in line<br></p>

<pre><code>TextBox t1 = row.FindControl("descTbx") as TextBox;
</code></pre>

<p>PageLoad code<bR></p>

<pre><code>    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            GrdV.DataSource = Session["tmdataTable"];
            GrdV.DataBind();
        }


        DataTable Finaldt = getTable();

        GrdV.DataSource = Finaldt;
        GrdV.DataBind();
        Session["tmdataTable"] = Finaldt;

    }
</code></pre>
