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 January 14th, 2004, 01:59 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default ObjectReference not set to object after CancelEdit

I've defined a bound datagrid in a Windows form. It displays fine and handles all updates OK EXCEPT...

I've added a ColumnChanging handler that under some circumstances, issues a CancelEdit call (I wish to reject the current record and instead create several new records in the table based on the information input). I've also tried RejectChanges and have the same problem.

This error does NOT occur when the CancelEdit or RejectChanges is issued. Instead, the program waits until the ColumnChanging handler completes and then it happens. Although there is no explicit call to it, the Public Class declaration at the top of the form code is immediately highlighted after hitting the End Sub of the ColumnChanging handler, and the error message then displays. Additionjally, the Details button on the error message box doesn't work and I have to click the X in the upper right hand corner to close it and shut down the applciation, so I have no further information.

What is going on?

Similar Threads
Thread Thread Starter Forum Replies Last Post
object reference not set to instant of an object shahidrasul ASP.NET 2.0 Basics 1 September 5th, 2008 02:01 PM
object variable not set naveed77 Beginning VB 6 2 January 2nd, 2008 12:37 AM
Object Reference not set to an instance of object srinivas_chakka ASP.NET 1.0 and 1.1 Professional 0 February 8th, 2006 11:56 AM

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