Solved

GridView Row Edit Cell Value in ASP.NET 2.0

Posted on 2010-08-13
2
769 Views
Last Modified: 2013-11-07
Hello Experts,

I need a cell value from Grid View Row_Edit.

Qty Name State
1     John    CA
2     DAVID  FL

When I edit second row, I need value of Name, I did something like this:

 Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing

Dim strName as string = GridView1.Rows(e.NewEditIndex).Cells(1).Text

 I get strName = ""


End Sub


How can I get cell value????
0
Comment
Question by:ASPDEV
2 Comments
 
LVL 16

Accepted Solution

by:
Kamal Khaleefa earned 500 total points
ID: 33435610
try one of this

Dim strName as string = GridView1.Rows(e.NewEditIndex).Cells(0).Text

or

Dim strName as string = GridView1.Rows(e.NewEditIndex).Cells(2).Text

of
Dim strName as string = GridView1.Rows(e.NewEditIndex).FindControl("ID Of your Controll")
0
 

Author Closing Comment

by:ASPDEV
ID: 33488340
Thanks,

It worked:
Dim EntryType As Label = GridView1.Rows(e.NewEditIndex).Cells(3).FindControl("lbltype")
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
TimeZone, day light savings, Sql server, asp.net 6 37
"Emulate" TAB key when press Enter Key 3 46
Formula for calculating ROI on training 6 49
exporting html table data 4 27
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

839 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