Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

Update Multiple Datagrid Rows

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Erik Lautier - 08 Apr 2008 21:03 GMT
I'm using an imagebutton in the datagrid footer to update a column of
textboxes in a "quantity" column with new values that the user
inputs.  I'm using a datatable, which I then bind the datagrid to.
I've got the basic premise - dim a textbox, loop through the
datatable, find the "Quantity" control, set the values to those of the
textbox in the templatecolumn - but I haven't been able to get this to
work at all after several hours now.  I've gone through tutorials but
nothing seems to do it...anyone have a code snippet to share?  Thanks
in advance.
Erik Lautier - 08 Apr 2008 22:50 GMT
By the way, here's the code I'm using that fails; it produces a
"Object reference not set to an instance of an object." error at the
line I've marked with several asterisks.  For some reason, quantityBox
is not being recognized.

Dim quantityCell As TableCell = e.Item.Cells(3)
Dim quantityBox As TextBox =
CType(quantityCell.FindControl("Quantity"), TextBox)
*****Dim quantity As Integer = System.Int32.Parse(quantityBox.Text)
Dim i as integer
for i = 0 to ObjDT.rows.count -1
objDT.rows(i).item("Quantity") = quantity
next

> I'm using an imagebutton in the datagrid footer to update a column of
> textboxes in a "quantity" column with new values that the user
[quoted text clipped - 5 lines]
> nothing seems to do it...anyone have a code snippet to share?  Thanks
> in advance.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.