473,378 Members | 1,555 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,378 software developers and data experts.

access all items in a datagrid

Hi Bruce,

As Cor's suggestion, it's better to post Web DataGrid
questions in either dotnet.framework.aspnet or more
specially in dotnet.framework.aspnet.datagrid group.

Anyway, following code shows to loop thru all items in a
datagrid:

For Each item As DataGridItem in datagrid.Items
Dim strItem = item.Cells(colIndex).Text ' for BoundColumn
strItem = CType(item.FindControl("contrlID"),
TextBox).Text ' for textbox in TemplateItem
' or you can cast the control to other specified type
Next

HTH

Elton Wang
el********@hotmail.com

-----Original Message-----
Hello all in mpdlv -

I have a newbie (to asp.net) datagrid question. I have no troublereading all the cells in the current row of the datagrid from asubroutine called by an event triggered by a change of a dropdown listcontained in the datagrid. (sorry about my excessive prepositionalphrases...)

However, I've been unable to figure out how to access other rows in thedatagrid. After updating this value, I want to be able to read throughthe entire grid to see if the user has completed everything.

I'm certain there must be a way to do this, but haven't figured out themagic words to make Google show me the way.

Best regards and many thanks in advance.

Bruce Dumes
.

Nov 21 '05 #1
0 939

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

Similar topics

2
by: Paul Daly (MCP) | last post by:
How do you access the value of a cell in a Windows form datagrid? I know this is how you would do it using an ASP.NET datagrid: DataGrid1.Items.Cells.Text However, "Items" is not available in...
4
by: Kaung Htut O via DotNetMonster.com | last post by:
Hi to all Is there a way to access Datalist Footer's Control properties from outside of datalist event. Pls note that I mean not a datagrid, only for datalist. Thanks Kaung Htut Oo
1
by: Raterus | last post by:
Hi, I'm using a datagrid, and the sub ItemDataBound to customize output of my datagrid when it is bound. Is the only way I can access the data in my datasource is to use ...
4
by: jenn | last post by:
Hi Anyone knows how to access to a value of a row in a datalist. Something like this in datagrid Dim str = MyDataGrid.Cell(0).tex I would like something like this Dim str =...
0
by: bill yeager | last post by:
I have a datalist displaying parent information and a datagrid presenting child information. The data is being rendered just fine. The datagrid has template columns on it that I cannot gain access...
1
by: bill yeager | last post by:
I did some more debugging and found the following: 1) I placed the following code in the button event just to see if I could cycle thru the datagrid control collection: <code> Dim strhello As...
1
by: Bruce Dumes | last post by:
I have a newbie (to asp.net) datagrid question. I have no trouble reading all the cells in the current row of the datagrid from a subroutine called by an event triggered by a change of a dropdown...
2
by: glenn | last post by:
Hi folks, Page_Load has the following definition: Sub Page_Load(sender as Object, e as EventArgs) As such, we are unable to instantiate a control that is inside a DataGrid since the e...
4
by: _MC_ | last post by:
Hi, I'm unable to access values in my Datagrid. Datagrid thinks it hase only 1 Cell. So here it is: The Datagrid is binded in PageLoad, AutoGenerateColumns is false, Columns are added on...
1
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...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.