473,657 Members | 2,385 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access all items in a datagrid



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 list
contained in the datagrid. (sorry about my excessive prepositional
phrases...)

However, I've been unable to figure out how to access other rows in the
datagrid. After updating this value, I want to be able to read through
the 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 the
magic words to make Google show me the way.

I realize that I can do a rebind and examine all elements one at a time,
but I believe that this only works for the current page of data, and I
need to be able to check the entire datagrid, not just what is being
displayed currently.

Best regards and many thanks in advance.

Bruce Dumes
Nov 19 '05 #1
1 1010
Bruce,

You can loop through myGrid.Items collection. An item represent a row. There
are different types of rows. You are probably mostly interested in data row
as opposed to header and footer. A good place to loop through all rows is
PreRender event. When you get there, all items are already fully built.

Eliyahu

"Bruce Dumes" <br********@dum es.net> wrote in message
news:%2******** *******@TK2MSFT NGP15.phx.gbl.. .


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 list
contained in the datagrid. (sorry about my excessive prepositional
phrases...)

However, I've been unable to figure out how to access other rows in the
datagrid. After updating this value, I want to be able to read through
the 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 the
magic words to make Google show me the way.

I realize that I can do a rebind and examine all elements one at a time,
but I believe that this only works for the current page of data, and I
need to be able to check the entire datagrid, not just what is being
displayed currently.

Best regards and many thanks in advance.

Bruce Dumes

Nov 19 '05 #2

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

Similar topics

2
1543
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 the Windows Forms datagrid. Thanks, Paul
4
5472
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
1297
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 DataBinder.Eval(e.Item.DataItem, "myFieldName") It just seems to be a little clunky to have to use this for every varible in my datasource, even more when using "option strict" you have to cast the
4
8298
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 = DataBinder.Eval(MyDatalist.Items(count).DataItem, "customerId") but it doesn't work.
0
1510
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 to in my Itemcommand event of the datalist. When I press a button on the datalist, that brings me into the Itemcommand event. I have access to the datagrid control, but not any column controls on the datagrid. For instance, my first column is...
1
1753
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 String Dim myDataListItem As DataListItem Dim myDatagridItem As DataGridItem Dim myCheckBox As CheckBox
3
1241
by: Michael | last post by:
Does anyone know how to export a data grid from asp.net into microsoft access? Thanks. Michael
0
951
by: Elton Wang | last post by:
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
2
1870
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 parameter is an EventArgs and not a DataGridCommandEventArgs type. If I have a ddl and I want to load items automatically as the page loads,
4
2106
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 PageLoad like this: BoundColumn Bound_Column = new BoundColumn(); Bound_Column.DataField = name; ( + HeaderText,
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8740
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7353
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.