Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 11th, 2004, 09:20 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataGrid Update Question

'Retrieving datagrid column information
Dim nameTextBox as textbox = e.Item.Cell(1).Controls(0)

Dim otherTextBox as TextBox = e.Item.Cell(2).Controls(1)

I know cell collection is indexed starting at zero, can any body explain me contols part in the code? (what is the difference between contols(0) and contols(1) )
 
Old June 11th, 2004, 10:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

If you use a bound column, you would refer to data in the cell as:

e.item.cells(n).text

However, you use use a column such as the template column, you can put one or more controls in it. You can then reference each control through the controls collection. For example, if you put a textbox and a linkbutton in a template control (in that order), you could reference the textbox by controls(0) and the linkbutton by controls(1).

Ideally, you want to have a controls collection because you don't want to limit a column to one control only.

Brian
 
Old June 11th, 2004, 10:40 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank You! Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Update a datagrid debbiecoates Beginning VB 6 0 January 4th, 2008 05:51 AM
datagrid update sumith ASP.NET 1.0 and 1.1 Basics 0 February 9th, 2007 02:14 AM
Update using the datagrid in C# jka_za C# 2005 0 September 22nd, 2006 06:02 AM
Datagrid.update() and DataAdapter.Update aarunlal ASP.NET 2.0 Professional 2 February 23rd, 2006 11:41 PM
Datagrid Does Not Update ... wecka .NET Framework 2.0 1 March 28th, 2005 04:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.