?
Solved

Edit row programmatically with gridview

Posted on 2006-04-20
4
Medium Priority
?
12,675 Views
Last Modified: 2012-05-05
Hi expert

i need to update a row programmatically

i use the gridview_updating handle but i don't how to retrieve the value edited

how can i do that

it's quiet urgent, thank you in advance

regards
0
Comment
Question by:Dnx_7
  • 3
4 Comments
 
LVL 37

Accepted Solution

by:
samtran0331 earned 1500 total points
ID: 16504480
use "findcontrol"

string firstName = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtFirstName")).Text;
or

dim tb as textbox = new textbox
tb =GridView1.Rows(e.RowIndex).FindControl("txtFirstName")
dim firstName as string = tb.text

you now have the string "firstName" to use in your update code
0
 
LVL 2

Author Comment

by:Dnx_7
ID: 16510934
i don't know how the id of the textbox of the gridview?

how can you retrieve it?

regards
0
 
LVL 2

Author Comment

by:Dnx_7
ID: 16520351
do u have sample code?

i'm stuck...

regards
0
 
LVL 2

Author Comment

by:Dnx_7
ID: 16520556
ok i find the solution :

CType(Me.Gridview.Rows(e.RowIndex).Cells(2).Controls(0), TextBox).Text

thanks to put me on the right way

0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month13 days, 22 hours left to enroll

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question