Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 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 July 27th, 2004, 05:10 PM
Authorized User
 
Join Date: Jun 2003
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to add data to a DataGrid Cell.


   Hi guyz i would like to add data to a datagrid cell that is bound to a table however, i have handled the column changed event of the table en every time i do this (Below).
   Public Shared Sub Column_Changed(ByVal sender As Object, ByVal e As DataColumnChangeEventArgs)
     e.Row.Item("fldDayPay") = 223
End Sub

I get a stackoverflow exception thrown. I think the reason is by doing this 'e.Row.Item("fldDayPay") = 223' inside the event it chages the column and the event is fired again which makes an infinite recursion.

   I would like to know if there is an easier way of doing this or how would you go about adding data to a cell in a datagrid

LION OF JUDDAH!
__________________
LION OF JUDDAH!
 
Old July 27th, 2004, 10:13 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Why are you trying to change the column value when the column value is changed?
 
Old July 28th, 2004, 01:24 AM
Authorized User
 
Join Date: Jun 2003
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Planoie

   e.Row.Item("fldDayPay") = 223 this bit is jus there for debugging reasons but still the problem persists.

The Case:: I have a table with 3 columns, if the first two cols are changed then the result of Multiplying the two cols are shown in the e.Row.Item("fldDayPay") column hence, e.Row.Item("fldDayPay") = 223.

   My problem is that everytime i change....ooooh **** i figured it out remove the handler... theheheheehehe am crazy



LION OF JUDDAH!





Similar Threads
Thread Thread Starter Forum Replies Last Post
how data grid of vb.net add cell color Nuwang Forum and Wrox.com Feedback 0 September 10th, 2008 08:36 PM
Blink Datagrid cell data?? vinodjangle ASP.NET 2.0 Professional 1 April 18th, 2008 09:51 AM
Using data from one cell to add to another LordJaffa Excel VBA 1 September 12th, 2007 03:27 PM
Getting DataGrid Cell Data lifewarped General .NET 2 February 20th, 2005 07:00 PM
Can't read new data from DataGrid cell Guest00 ASP.NET 1.0 and 1.1 Basics 3 October 17th, 2004 11:51 PM





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