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 / .NET Framework / New Users / September 2004

Tip: Looking for answers? Try searching our database.

.NET 1.1 SP1 breaks class inherited from Windows.Forms.Datagrid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Urs Eichmann - 10 Sep 2004 12:14 GMT
After installing SP1, we have huge problems with a self-grown class
which inherits from Windows.Forms.Datagrid. It throws exceptions every
now and then, such as this:

System.NullReferenceException: Object reference not set to an instance
of an object.
-------
   at System.Data.DataTable.RecordStateChanged(Int32 record1,
DataViewRowState oldState1, DataViewRowState newState1, Int32 record2,
DataViewRowState oldState2, DataViewRowState newState2)
-------
   at System.Data.DataTable.SetNewRecord(DataRow row, Int32
proposedRecord, DataRowAction action, Boolean isInMerge)
-------
   at System.Data.DataRow.EndEdit()
-------
   at System.Data.DataRowView.EndEdit()
-------
   at System.Windows.Forms.CurrencyManager.EndCurrentEdit()
-------
   at System.Windows.Forms.CurrencyManager.ChangeRecordState(Int32
newPosition, Boolean validating, Boolean endCurrentEdit, Boolean
firePositionChange, Boolean pullData)
-------
   at System.Windows.Forms.CurrencyManager.set_Position(Int32 value)
-------
   at System.Windows.Forms.DataGrid.set_Item(Int32 rowIndex, Int32
columnIndex, Object value)
-------
   at
PRISMA.BOBJ.Client.ConnectedControls.MyDataGrid.UpdateNotConnectedColumns(Int32
vRowNum, GridDefinition vGridDefinition) in
c:\VSSLOCAL\BOBJ\Src\PRISMA.BOBJ.Client\ConnectedControls\ConnectedDataGrid.vb:line
1359
-------
   at
PRISMA.BOBJ.Client.ConnectedControls.ConnectedDataGrid.UpdateNotConnectedColumns()
in
c:\VSSLOCAL\BOBJ\Src\PRISMA.BOBJ.Client\ConnectedControls\ConnectedDataGrid.vb:line
490
-------
   at
PRISMA.BOBJ.Client.ConnectedControls.ConnectedDataGrid.FillGridWithData()
in
c:\VSSLOCAL\BOBJ\Src\PRISMA.BOBJ.Client\ConnectedControls\ConnectedDataGrid.vb:line
472
-------
   at
PRISMA.BOBJ.Client.ConnectedControls.ConnectedDataGrid.FillInputComponent()
in
c:\VSSLOCAL\BOBJ\Src\PRISMA.BOBJ.Client\ConnectedControls\ConnectedDataGrid.vb:line
282
-------
   at
PRISMA.BOBJ.Client.Bases.BaseLivingControlImplementation.RefreshData()
in
c:\VSSLOCAL\BOBJ\Src\PRISMA.BOBJ.Client\Bases\BaseLivingControlImplementation.vb:line
179
-------
   at
PRISMA.Alim2000.Zahlungserfassung.Panels.MyZahlungsZuteilungsDataGrid.RefreshData()
in
c:\VSSLOCAL\ALIM2000\Src\PRISMA.Alim2000.Lib\Zahlungserfassung\Panels\Panel_Zahlung.vb:line
2602
-------
   at
PRISMA.Alim2000.Zahlungserfassung.Panels.Zahlung.OnApplicationIdle(Object
vSender, EventArgs vEv) in
c:\VSSLOCAL\ALIM2000\Src\PRISMA.Alim2000.Lib\Zahlungserfassung\Panels\Panel_Zahlung.vb:line
349
-------
   at System.EventHandler.Invoke(Object sender, EventArgs e)
-------
   at
System.Windows.Forms.ThreadContext.System.Windows.Forms.UnsafeNativeMethods+IMsoComponent.FDoIdle(Int32
grfidlef)
-------
   at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
-------
   at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32
reason, ApplicationContext context)
-------
   at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
-------
   at System.Windows.Forms.Application.Run(Form mainForm)
-------
   at PRISMA.Alim2000.WinApp.Main.Main() in
c:\VSSLOCAL\ALIM2000\Src\PRISMA.ALIM2000.WinApp\Main.vb:line 108

Before installing SP1, there was no problem whatsoever with this code.
Now more and more of our customers are installing SP1 because it is a
"critical update" on windowsupdate.com - and our application fails...
Not nice, Microsoft!!! Note that our custom datagrid class only uses
"allowed" methods of inheriting and overriding, no calling of private
methods via Reflection, or similar disallowed things! This MUST NOT
happen with a SP, it HAS TO BE 100 % compatible!

This is just to inform everyone of this problem. Now I'm going to have a
look into the code... hope I can still enjoy my weekend.

If anybody has a workaround or an idea where to look, I'd be very grateful.

Urs
Urs Eichmann - 10 Sep 2004 13:23 GMT
I found the cause, it seems that the ListChanged event of the underlying
DataView is being raised on slightly different circumstances, causing
unexpected EndEdit calls to happen (which are made by our inherited
class). I put in some additions helper flags in the code, now it
works... but I still think it is not good to change something like this
in a SP which is automatically installed on client machines.

Regards,
Urs

> After installing SP1, we have huge problems with a self-grown class
> which inherits from Windows.Forms.Datagrid. It throws exceptions every
[quoted text clipped - 102 lines]
>
> Urs

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.