473,320 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Getting the value of a databound cell in a datagrid in a loop

Ok, I am stumped.

I can get the value of a cell in the item command event with
e.item.cells(3).text

but what I need to do is loop through a datagrid rows and get the
values of a paticular column, hence I do not have the "e"

I am looping through with:

For Each dgitem In DataGrid1.Items

Any help would be GREATLY apprceiated.

Russ
Nov 18 '05 #1
1 1811
Hi,

e.Item in the ItemCommand is reference to the DataGridItem as is dgItem in
the loop. Therefore that would be:

For Each dgitem In DataGrid1.Items
dgItem.Cells(3).Text...
Next

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"OrlandoRocks" <pa********@orlandorocks.com> wrote in message
news:55**************************@posting.google.c om...
Ok, I am stumped.

I can get the value of a cell in the item command event with
e.item.cells(3).text

but what I need to do is loop through a datagrid rows and get the
values of a paticular column, hence I do not have the "e"

I am looping through with:

For Each dgitem In DataGrid1.Items

Any help would be GREATLY apprceiated.

Russ

Nov 18 '05 #2

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

Similar topics

2
by: Graham Y | last post by:
I have a datagrid, populated via a SQL dataset, and I want the user to select a row by clicking on it and then using the value in the first cell as my key for my next query. Using...
4
by: kscdavefl | last post by:
I ahve a datagrid on a web form. I need to change the value in column 3 as follows. If the value in column 3 reads 0, I want to change it to read YES. How can I accomplish this task. ...
1
by: Blake Versiga | last post by:
When editing a datagrid (C#) I need to know if the user changed the value of cell AND what the previous value was. Is this possible? If so how do I get the previous value or at least if the...
5
by: Jason | last post by:
I've been trying to figure out a good way to do this but haven't had much luck, any input would be greatly appreciated. Basically, after a datagrid is sorted, how can I get the primary key value...
3
by: Dinçer | last post by:
Hi all! I want to get the datafield value of a cell in a datagrid item. How can I do this? I have a for loop (as below) and I am able to get the data in the cell, but not the datafield value. ...
2
by: niceguy | last post by:
Hi I was wondering if its possible to get the exact displayed text from a cell in a datagrid. I need to get the displayed text and not any 'real' database value or anything that the cell...
4
by: gugu | last post by:
Hi I have a datagrid which has 20 rows and 20 columns, 15 of 20 columns are checkboxs and their headertexts, datafields are dynamic. I need to loop through the whole page to see if the specific...
3
by: Jeff | last post by:
Help.. I have been using: string sId = ((System.Web.UI.WebControls.TextBox)e.Item.Cells.Controls).Text; To get the value of a cell in my datagrid. When I set the cell to read only, I get...
2
by: KerryL | last post by:
How do I update the value of a databound column within my datagrid from within the SelectedIndexChanged event of a dropdownlist, also found within my datagrid? I believe I need to determine the...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.