DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Unable to read Textbox value via Gridview in Edit Mode

  1. #1
    Join Date
    Oct 2009

    Unable to read Textbox value via Gridview in Edit Mode

    I am trying to read new value from my Gridview after user changed it to Edit Mode but failed.

    It just retains the original value when I retrieve.

    Anyone experienced it ? Thanks.


    Here are my code in .asp and .cs file

    <asp:TemplateField HeaderText="Comments">
    <asp:Label ID="lblComments" Runat="server" Text='<%# Bind("Comments") %>' />
    <asp:TextBox SkinID="txt" Width="500px" ID="txtComments" runat="server" />


    protected void gvList_RowUpdating(object sender, GridViewUpdateEventArgs e)
    TextBox txtOverride = (TextBox)gvList.Rows[e.RowIndex].FindControl("txtOverride");
    TextBox txtOverrideMin = (TextBox)gvList.Rows[e.RowIndex].FindControl("txtOverrideMin");
    TextBox txtOverrideMax = (TextBox)gvList.Rows[e.RowIndex].FindControl("txtOverrideMax");
    TextBox txtComments = (TextBox)gvList.Rows[e.RowIndex].FindControl("txtComments");
    TextBox txtcustomer = (TextBox)gvList.Rows[e.RowIndex].FindControl("txtcustomer");

    Int32.TryParse(txtOverride.Text, out Qty_override);
    Int32.TryParse(txtOverrideMin.Text, out Qty_override_min);
    Int32.TryParse(txtOverrideMax.Text, out Qty_override_max);

    comments = txtComments.Text;


  2. #2
    Join Date
    Oct 2009
    The value I want to read is comments ... sorry for not putting it up earlier.

    comments = txtComments.Text;

    always return me the original value and not the one I modified.

Similar Threads

  1. Replies: 0
    Last Post: 02-28-2003, 12:10 PM
  2. Replies: 0
    Last Post: 02-26-2003, 10:30 PM
  3. Char. Indexes in a TextBox
    By Ozzy in forum VB Classic
    Replies: 7
    Last Post: 03-25-2002, 02:47 PM
  4. Replies: 0
    Last Post: 06-29-2000, 05:25 AM
  5. Replies: 0
    Last Post: 06-29-2000, 05:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center