Solved

GridView Row Edit Cell Value in ASP.NET 2.0

Posted on 2010-08-13
2
764 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Connecting database in Xamarin? 6 48
error on the asp.net page 1 33
Error on link 14 36
What do you call this line of code in this .NET Core page? 4 16
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 …
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

932 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now