Solved

GridView Row Edit Cell Value in ASP.NET 2.0

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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