Edit item template as a paramter??

Last post 07-05-2009 10:40 AM by superguppie. 2 replies.

Sort Posts:

  • Edit item template as a paramter??

    07-05-2009, 5:41 AM

    Hi.. I just want to ask on how can I send a value of my edit item template field (textbox), as an update parameter.. Im planning to use the Row Updating event for gridview, but how can i get the value of the textbox?  Thnx

  • Re: Edit item template as a paramter??

    07-05-2009, 8:17 AM
    Answer
    • Member
      178 point Member
    • pavan496
    • Member since 06-18-2009, 8:44 PM
    • Hyderabad
    • Posts 63

    To get the text entered in the textbox, use the following code

    string text = ((TextBox)(GridView1.Rows[e.RowIndex].FindControl("TextBox1"))).Text

    The code is used to search for the control in the current row(the row being updated), and getting its text property.

    GridView1 is the ID of the gridview

    TextBox1 is the id of the TextBox inside the gridview

    Thanks

    PaVaN
  • Re: Edit item template as a paramter??

    07-05-2009, 10:40 AM
    Answer
    • Contributor
      7,023 point Contributor
    • superguppie
    • Member since 05-19-2009, 7:42 AM
    • Posts 1,240
    If you use Bind() to put the value into the TextBox, than the value will be in the e.NewValues dictionary in RowUpdating
    Superguppie.

    Please remember to click “Mark as Answer” on the post that helps you.
    This can be beneficial to other community members reading the thread.

    When all you've got is a Hammer,
    Every Problem looks like a Nail.
    Michael Swain.
Page 1 of 1 (3 items)