473,491 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

GridView and Edit of current row

I have a GridView with an edit button. When the user clicks 'Edit', I want
to display the information in a form and allow the user to edit the
information. I have a RowCommand event in which I take the data from the
row and update form controls. How do I know in the RowCommand what the
current row is? I tried GridView.Rows[EditIndex] but I get a -1 when I do
that.

ex.

DateOccured.Text =
TimeSheetGridView.Rows[TimeSheetGridView.EditIndex].Cells(4).Text;

Bill
Aug 5 '07 #1
1 1818
Hi,

See if this helps:
http://www.c-sharpcorner.com/Blogs/B...spx?BlogId=231

"Bill Gower" wrote:
I have a GridView with an edit button. When the user clicks 'Edit', I want
to display the information in a form and allow the user to edit the
information. I have a RowCommand event in which I take the data from the
row and update form controls. How do I know in the RowCommand what the
current row is? I tried GridView.Rows[EditIndex] but I get a -1 when I do
that.

ex.

DateOccured.Text =
TimeSheetGridView.Rows[TimeSheetGridView.EditIndex].Cells(4).Text;

Bill
Aug 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
11742
by: Simon Strandgaard | last post by:
Hi group, my setup: I have a GridView that extracts data from my table (a SqlDataSource). For each row, I have an 'edit' button and a 'delete' button. The 'edit' button opens a popup, through...
2
3791
by: VB Programmer | last post by:
I have a gridview control with several data fields. When the user clicks 'edit' for the row I want the user to be able to edit a particular text field. Under that 'edit' textbox is a button. ...
0
2465
by: Mike P | last post by:
I am trying to edit a gridview while using paging, but whenever I try to edit a row on a page other than page 1, I get an error. Here is my gridview and my code : <asp:GridView ID="GridView1"...
0
3542
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
1
12206
by: cyningeston | last post by:
OS: WinXP Pro, VB/ASP/ADO.NET I'm building a web-based supplier management application. For each supplier we are required by the FDA to track certain documents. I've managed to pull them from...
1
7751
by: mitchman10 | last post by:
My Time table has TimeID,Employee,PayPeriod,ChargeCodeID,Hours My Chargecode table has ChargecodeID,c_Text I need an Editable datagrid that will show the TimeID,Employee,PayPeriod,C_Text in a...
1
1785
by: pieandpeas | last post by:
he selectedindex of my gridview is always one behind for example, if i click on the EDIT.gif on row 1, then 5 , then 7, if i break the code and check the selectedindex, it is equal to 5. if i...
11
4051
by: Ed Dror | last post by:
Hi there, I'm using ASP.NET 2.0 and SQL Server 2005 with VS 2005 Pro. I have a Price page (my website require login) with GridView with the following columns PriceID, Amount, Approved,...
0
10071
by: =?Utf-8?B?ZWdzZGFy?= | last post by:
Hi, I have created a second gridview when customer clicks on select link with this code: Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6858
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.