Can anyone shed some light on this error?
System.ArgumentException: {"Key not foundParameter name: key"}
Message:Key not foundParameter name: key
StackTrace: at Infragistics.Shared.KeyedSubObjectsCollectionBase.GetItem(String key) at Infragistics.Win.UltraWinGrid.ColumnsCollection.get_Item(String key) at NBSControls.BondSourcesUsesBase.ugSources_InitializeLayout(Object sender, InitializeLayoutEventArgs e) in C:\Documents and Settings\mhsueh\My Documents\Visual Studio 2005\Projects\DFAST3\Controls\District\BondSourcesUsesBase.vb:line 29
The error message you posted here clearly indicates that the exception is occurring in the InitializeLayout event of the grid. So some code in that event is referring to an object in a collection by key and that key does not exist in the collection. The message specifically refers to the columns collection.
So if you are getting an exception on the toolbar, also, then the call stack you posted here must be the wrong one.
Did you try breaking on all exceptions like I suggested?
FYI, I also replied to the "Key not found for UltraToolbar" posting. That may help you understand what I am up against.
I am getting this error on the toolbar, not the wingrid. I am looking for a solution, and following all threads. This began yesterday when I went through and changed some captions on toolbar buttons, compiled the app, ran it, and the new caption values were not present at runtime. I then went through and updated the keys for each toolbar button to match the caption. After that change, things go boom! I keep getting this "key not found" error. I have copied and pasted, etc. to make sure they all have the same verbage and the problem continues. I admit, I am new to your controls. I started this job 2 months ago and I am working to make requested mods to an existing application. Feel free to email me off-line.
What does the "toolbar customize" have to do with it? The error message here is referring to the Columns collection in a WinGrid control.
Have you tried stepping through the InitializeLayout code to see what line of code the error is occurring on?
This error message is very clear and very common. There's no mystery about it. Your code is definitely trying to access a column in the grid using a Key that does not exist in the collection.
If the Debugger doesn't break on the exact line of code that's causing the issue, then you may need to set Visual Studio to break on all run-time exceptions - the error is probably being caught by the grid and masking the true source of the error.
That was my first thought, but I have been through the tools multiple times, and compared values in the toolbar customize with values in the <formname>.designer.cs to make sure everything was in sync, and the error still occurs.