|
-
Nov 23rd, 2007, 06:37 PM
#1
Thread Starter
New Member
Dynamically updating a row in Datagridview
Hi,
I have a VB.NET 2005 windows forms app with a heaps of forms most with at least one datagridview on them. I've got most of it working however I'm stuck on one part. The grids are databound to tables in a dataset. When a user updates a new I want to change 2 read only cells on that row to record the userid and time of change. I've tried this in the CellValueChanged event but this causes a stackoverflowexception because, I guess, it then calls itself again and goes into a loop. My question is where do I put the code to update a cell dynamically when a user updates a cell in a row ?? I want to update these cells and then when they click the save button it does an update. The update is working fine, it's just updating the audit cells that is the problem.
thanks
Dave
-
Nov 24th, 2007, 08:50 PM
#2
Re: Dynamically updating a row in Datagridview
The CellValueChanged event is the correct choice. You must just not have used appropriate code. As you haven't shown us the code you're using we can't tell you what's wrong with it. My guess is that you are setting these values for every column, when you should be ignoring the columns that you're actually setting. Obviously you don;t want to change the userid a time columns when the userid and time columns change, so you shouldn't.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|