I migrated a win-application from IG 2008 vol 1 to IG 2008 vol 2. After compiling and start I get a NullReferenceException on initializing a new Form.
In the form is a UltraGrid with an UltraDataSource (dsMain) that will be filled manualy.
The Exception is thrown in the InitializeComponent method of my form.
private void InitializeComponent(){
// ...
((System.ComponentModel.ISupportInitialize)(this.dsMain)).EndInit();
}
private Infragistics.Win.UltraWinDataSource.UltraDataSource dsMain;
The StackTrace is:
bei Infragistics.Win.UltraWinDataSource.UltraDataSource.UDSBindingSource.SetBindingSources(UltraDataBand band, Dictionary`2 bindingSources) bei Infragistics.Win.UltraWinDataSource.UltraDataSource.UDSBindingSource.InternalSetBand(UltraDataBand band, Dictionary`2 oldBindingSources) bei Infragistics.Win.UltraWinDataSource.UltraDataSource.OnDeserializationComplete(UltraDataRowsCollection deserializedRows, Dictionary`2 oldBindingSources) bei Infragistics.Win.UltraWinDataSource.UltraDataSource.System.ComponentModel.ISupportInitialize.EndInit() bei MyApp.MyForm.InitializeComponent() in D:\MyApp\MyForm.Designer.cs:Zeile 360.
I hope someone can help me!
Michael
Hi Michael,
Does this happen every time? Can you duplicate this in a small sample project? If so, you should Submit an incident to Infragistics Developer Support so they can check it out. If this worked in the previous version, it seems like it's probably a bug.
Hi Mike,
1) Yes it does every time, when I start my small demo (see attached archive IGDemo.zip).
2) Unfortunately I found an other bad thing about the new Version of IG.
The visual studio designer add every time when I modify something in the grid (like the size of a column) some lines of code to the designer file (MyForm.Designer.cs) that can't be compiled:
// // gridMain // this.gridMain.DataSource = this.bsMain; appearance2.BackColor = System.Drawing.Color.White; appearance2.BorderColor = System.Drawing.Color.SlateGray; ApplyResources(appearance2.FontData, "appearance2.FontData"); ApplyResources(appearance2, "appearance2");
Is this an bug?
That looks like a bug I have come across a couple of times when upgrading projects from earlier version of visual Studio into VS2008. It's nothing to do with the grid or the Infragistics controls as far as I know.
Try changing it to:
resources.ApplyResources(appearance2.FontData, "appearance2.FontData");
Could you reproduce the NullReferenceException with my sample?
PS: I use VS 2005
Oh, I didn't notice the sample at first.
I just ran it now and yes, I can reproduce the NullReferenceException. This appears to have been introduced by a recent bug fix. You should Submit an incident to Infragistics Developer Support. If you include your same sample project you have attached here, they should be able to track it down and get it fixed.
If you are experiencing the same issue, you should conteact Developer Support. They can update you on the status of the issue and notify you when a fix becomes available.
has this bug been fixed?