passing gridview value into textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Imran I
    New Member
    • Mar 2012
    • 1

    passing gridview value into textbox

    Hello all,

    I have a textbox and asp.net Gridview control which has 3 columns. ID, email, and onecolumn with a link called EDIT.
    What i want is that when i click EDIT link, the value of email cell is passed into textbox so that i can change it. And when i click the SAVE button, the page refreshes and value is updated in Gridvkew. No database is involved.

    The textbox is not inside Gridview. it is placed separately on the same page.

    Please help.

    thanks
  • RhysW
    New Member
    • Mar 2012
    • 70

    #2
    in the edit button click event:
    Code:
    gridview.SelectedRows[0].Cells[1].Value = textbox.text
    this presumes that you can only select one row at a time and that email is in the second cell along, this will set that cells value to whatever is in the textbox when you press the button
    thats how it is in windowsforms havent tested this in an asp.net web form yet but the theory is the same

    Comment

    Working...