473,569 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access all items in a datagrid

Hi Bruce,

As Cor's suggestion, it's better to post Web DataGrid
questions in either dotnet.framewor k.aspnet or more
specially in dotnet.framewor k.aspnet.datagr id 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(colI ndex).Text ' for BoundColumn
strItem = CType(item.Find Control("contrl ID"),
TextBox).Text ' for textbox in TemplateItem
' or you can cast the control to other specified type
Next

HTH

Elton Wang
el********@hotm ail.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 948

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

Similar topics

2
1541
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
5469
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
1293
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...
4
8282
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
1507
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...
1
1749
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
1
1009
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 list contained in the datagrid. (sorry about my excessive prepositional phrases...) However, I've been unable to figure out how to access other...
2
1868
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
2104
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
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
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...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7676
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
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...
0
5219
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...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
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...

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.