title: Edit textbox of gridview cell?
body: <p>I have a gridview having two columns name and address and a save button.
  Its a autogenerated column grid.</p>
  
  <pre><code>&lt;asp:GridView ID="gvStandardSummary" runat="server" HeaderStyle-CssClass="columnheaderLightBlue"
                                              AlternatingRowStyle-CssClass="infoarea" Width="100%" AutoGenerateColumns="true"
                                              AllowPaging="true" PageSize="20" OnPageIndexChanging="gvStandardSummary_PageIndexChanged"
                                              OnRowDataBound="gvStandardSummary_OnRowDataBound" EmptyDataText="No work items to display."
                                              EmptyDataRowStyle-CssClass="infoarea" OnRowCommand="gvStaffingPlan_RowCommand"&gt;
  
                                          &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>I cannot use Item template.I need a inline edit for address column only .</p>
  
  <p>when i click on address field it will become editable ...i will edit ...then click second record address edit  ...and finally save it ..</p>
  
  <p>On saving it should update database and Reload.I can not use item templete and have to add textbox in Rowdaabound ...but nneed the exact solution ...Any help</p>
  
  <p>In Row data boung i am adding a textbox</p>
  
  <pre><code>TextBox txtAddress = new TextBox();
                  txtAddress.ReadOnly = false;
                  e.Row.Cells[1].Controls.Add(txtAddress);
                  e.Row.Cells[1].Style.Add("text-align", "center");
  </code></pre>
  
  <p>Here how can i auto fit it in cell ...and Make it editable</p>
  
  <p>because i am not using Wrapping here</p>
  
  <pre><code>for (int i = 0; i &lt; e.Row.Cells.Count; i++)
                          {
                              e.Row.Cells[i].Attributes.Add("style", "white-space:nowrap;");
  
  
                          }
  </code></pre>
  
  <p>Columns should be expand and collapse based on texts
                          txtpkgNumber.Text = e.Row.Cells[0].Text;</p>