Hi,
I am using an UltraWinGrid to display properties of SQL database tables in the switchboard screen of my app.
All of the databases involved, except 1, recieve the data in the same format. That last database has a join to a definitions table I am using. This makes their set of field names different. ... i think I just answered my own question as to how to workaround... but.
That doesn't let you guys off the hook :)
If I have opened the Field Chooser and then switch between those two databases then the whole app flushes with the dreaded key not found error.
I looked very hard but found no way to access and so catch anything to do with the FieldChooser from the model. The examples I found that gave me hope are for WPF...
I am going to force the two datasources to have the same field names and try to just adjust the visibles and 'hide from FieldChooser' settings on the fly ... that should do it...
Mind you if this blows up to when I hide the fields from the field chooser, too, I can name a certain Fortune 500 company that will be taking a closer look at certain Brand X control packages.... :)
Thanks in advance guys,
Mitch
Hi Mitch,
I'm having a little trouble following you. By "Field Chooser", I assume you mean the UltraGridColumnChooser. Is that right? Or are you using some other component I am not familiar with?
If changing the DataSource on your grid is blowing up the Field Chooser, that's clearly a bug. That should not happen. Are you sure it's the ColumnChooser blowing up and not something in your code, like maybe you are trying to reference a grid column using a Key that no longer exists in one of the grid's events?
Can you post the call stack of the exception, or better yet a sample project demonstrating the exception?
Thanks, Mike.
What I would really like to be able to do is just before I switch between these two datatables (which have different field sets), just close the ColumnChooser 'dialog' but I don't see any way to get to it from the IG model. If the Column Chooser is closed when the user jumps from the one 'flavor' datatable to the other ... no problem. It can be opened on the new set of fields and it works like a charm. But if the Chooser is open when I switch, the whole crashes and i can't even get to a place in the model to catch the 'Key not Found'...
Here is a stack trace of the 'crash'.
(kind of long...)
************** Exception Text **************System.ArgumentException: Key not foundParameter name: key at Infragistics.Shared.KeyedSubObjectsCollectionBase.GetItem(String key) at Infragistics.Win.UltraWinGrid.ColumnsCollection.get_Item(String key) at Infragistics.Win.UltraWinGrid.CellsCollection.GetItem(String key) at Infragistics.Win.UltraWinGrid.CellsCollection.get_Item(String key) at Infragistics.Win.UltraWinGrid.UltraGridColumnChooser.displayGrid_InitializeRow(Object sender, InitializeRowEventArgs e) at Infragistics.Win.UltraWinGrid.UltraGrid.OnInitializeRow(InitializeRowEventArgs e) at Infragistics.Win.UltraWinGrid.UltraGrid.FireEvent(GridEventIds id, EventArgs e) at Infragistics.Win.UltraWinGrid.UltraGrid.FireInitializeRow(InitializeRowEventArgs e) at Infragistics.Win.UltraWinGrid.UltraGridRow.FireInitializeRow() at Infragistics.Win.UltraWinGrid.RowsCollection.FireInitializeRow(IList rows) at Infragistics.Win.UltraWinGrid.RowsCollection.InitNonGroupByRows(IList fireInitializeRowOnTheseRows) at Infragistics.Win.UltraWinGrid.RowsCollection.SyncRowsHelper(IList boundList) at Infragistics.Win.UltraWinGrid.RowsCollection.SyncRows() at Infragistics.Win.UltraWinGrid.RowsCollection.EnsureNotDirty() at Infragistics.Win.UltraWinGrid.RowsCollection.get_Count() at Infragistics.Win.UltraWinGrid.RowsCollection.GetSpecialRowsHelper(Type rowType, List`1 list, Boolean top, UltraGridRow[] rowsToRecycle) at Infragistics.Win.UltraWinGrid.RowsCollection.GetSpecialRowsHelper(List`1 list, Boolean top, UltraGridRow[] rowsToRecycle) at Infragistics.Win.UltraWinGrid.RowsCollection.CalcSpecialAndFixedRowsHelper(List`1& outSpecialRows, List`1& outFixedRows, Boolean top, UltraGridRow[] rowsToRecycle) at Infragistics.Win.UltraWinGrid.RowsCollection.EnsureSpecialAndFixedRowsCacheCalculated() at Infragistics.Win.UltraWinGrid.RowsCollection.GetRowAtVisibleIndex(Int32 visibleIndex, Boolean includeSpecialRows) at Infragistics.Win.UltraWinGrid.RowsCollection.GetFirstVisibleRow() at Infragistics.Win.UltraWinGrid.RowScrollRegion.get_FirstRow() at Infragistics.Win.UltraWinGrid.RowScrollRegion.GetMaxScrollPosition(Boolean scrollToFill, Boolean ignoreScrollBoundsResolved) at Infragistics.Win.UltraWinGrid.RowScrollRegion.EnsureScrollRegionFilled(Boolean calledFromRegenerateVisibleRows) at Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows(Boolean resetScrollInfo) at Infragistics.Win.UltraWinGrid.RowScrollRegion.WillScrollbarBeShown(ScrollbarVisibility assumeColScrollbarsVisible) at Infragistics.Win.UltraWinGrid.ViewStyleBase.FitColumnsToWidth() at Infragistics.Win.UltraWinGrid.BandsCollection.CalculateBandMetrics(Int32 pass) at Infragistics.Win.UltraWinGrid.BandsCollection.CalculateBandMetrics() at Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetricsHelper() at Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetrics() at Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows(Boolean resetScrollInfo) at Infragistics.Win.UltraWinGrid.RowScrollRegion.WillScrollbarBeShown(ScrollbarVisibility assumeColScrollbarsVisible) at Infragistics.Win.UltraWinGrid.RowScrollRegion.PositionScrollbar(Boolean resetScrollInfo) at Infragistics.Win.UltraWinGrid.ScrollRegionBase.SetOriginAndExtent(Int32 origin, Int32 extent) at Infragistics.Win.UltraWinGrid.RowScrollRegion.SetOriginAndExtent(Int32 origin, Int32 extent) at Infragistics.Win.UltraWinGrid.DataAreaUIElement.ResizeRowScrollRegions() at Infragistics.Win.UltraWinGrid.DataAreaUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.DataAreaUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.DataAreaUIElement.set_Rect(Rectangle value) at Infragistics.Win.UltraWinGrid.UltraGridUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UltraWinGrid.UltraGridUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize, Boolean preventAlphaBlendGraphics) at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode) at Infragistics.Win.UltraWinGrid.UltraGridUIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode) at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe) at Infragistics.Win.UltraWinGrid.UltraGrid.OnPaint(PaintEventArgs pe) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18063 built by: FX45RTMGDR CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll----------------------------------------Microsoft.VisualStudio.HostingProcess.Utilities Assembly Version: 11.0.0.0 Win32 Version: 11.0.50727.1 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.HostingProcess.Utilities/11.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.HostingProcess.Utilities.dll----------------------------------------System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18036 built by: FX45RTMGDR CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll----------------------------------------System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18021 built by: FX45RTMGDR CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll----------------------------------------System Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18021 built by: FX45RTMGDR CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll----------------------------------------Microsoft.VisualStudio.HostingProcess.Utilities.Sync Assembly Version: 11.0.0.0 Win32 Version: 11.0.50727.1 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.HostingProcess.Utilities.Sync/11.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll----------------------------------------Microsoft.VisualStudio.Debugger.Runtime Assembly Version: 11.0.0.0 Win32 Version: 11.0.50727.1 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualStudio.Debugger.Runtime/11.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.Debugger.Runtime.dll----------------------------------------vshost32 Assembly Version: 11.0.0.0 Win32 Version: 11.0.50727.1 CodeBase: file:///D:/Projects/LOBSAPSolution/SQLDatabaseExplorer/SQLDatabaseExplorer/bin/Debug/SQLDatabaseExplorer.vshost.exe----------------------------------------DocumentFormat.OpenXml Assembly Version: 2.0.5022.0 Win32 Version: 2.0.5022.0 CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/DocumentFormat.OpenXml/2.0.5022.0__31bf3856ad364e35/DocumentFormat.OpenXml.dll----------------------------------------Infragistics4.Documents.Excel.v12.2 Assembly Version: 12.2.20122.1006 Win32 Version: 12.2.20122.1006 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Infragistics4.Documents.Excel.v12.2/v4.0_12.2.20122.1006__7dd5c3163f2cd0cb/Infragistics4.Documents.Excel.v12.2.dll----------------------------------------Infragistics4.Documents.Reports.v12.2 Assembly Version: 12.2.20122.1006 Win32 Version: 12.2.20122.1006 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Infragistics4.Documents.Reports.v12.2/v4.0_12.2.20122.1006__7dd5c3163f2cd0cb/Infragistics4.Documents.Reports.v12.2.dll----------------------------------------Infragistics4.Shared.v12.2 Assembly Version: 12.2.20122.1006 Win32 Version: 12.2.20122.1006 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Infragistics4.Shared.v12.2/v4.0_12.2.20122.1006__7dd5c3163f2cd0cb/Infragistics4.Shared.v12.2.dll----------------------------------------Infragistics4.Win.Misc.v12.2 Assembly Version: 12.2.20122.1006 Win32 Version: 12.2.20122.1006 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Infragistics4.Win.Misc.v12.2/v4.0_12.2.20122.1006__7dd5c3163f2cd0cb/Infragistics4.Win.Misc.v12.2.dll----------------------------------------Infragistics4.Win.UltraWinEditors.v12.2 Assembly Version: 12.2.20122.1006 Win32 Version: 12.2.20122.1006 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Infragistics4.Win.UltraWinEditors.v12.2/v4.0_12.2.20122.1006__7dd5c3163f2cd0cb/Infragistics4.Win.UltraWinEditors.v12.2.dll----------------------------------------Infragistics4.Win.UltraWinGrid.ExcelExport.v12.2 Assembly Version: 12.2.20122.1006 Win32 Version: 12.2.20122.1006 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Infragistics4.Win.UltraWinGrid.ExcelExport.v12.2/v4.0_12.2.20122.1006__7dd5c3163f2cd0cb/Infragistics4.Win.UltraWinGrid.ExcelExport.v12.2.dll----------------------------------------Infragistics4.Win.UltraWinGrid.v12.2 Assembly Version: 12.2.20122.1006 Win32 Version: 12.2.20122.1006 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Infragistics4.Win.UltraWinGrid.v12.2/v4.0_12.2.20122.1006__7dd5c3163f2cd0cb/Infragistics4.Win.UltraWinGrid.v12.2.dll----------------------------------------Infragistics4.Win.v12.2 Assembly Version: 12.2.20122.1006 Win32 Version: 12.2.20122.1006 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Infragistics4.Win.v12.2/v4.0_12.2.20122.1006__7dd5c3163f2cd0cb/Infragistics4.Win.v12.2.dll----------------------------------------System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18060 built by: FX45RTMGDR CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll----------------------------------------System.Data Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll----------------------------------------System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll----------------------------------------System.Data.Linq Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18060 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Data.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Data.Linq.dll----------------------------------------System.Deployment Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Deployment/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll----------------------------------------System.Runtime.Serialization.Formatters.Soap Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization.Formatters.Soap/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.Serialization.Formatters.Soap.dll----------------------------------------System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18060 built by: FX45RTMGDR CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll----------------------------------------System.Xml.Linq Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll----------------------------------------System.Data.DataSetExtensions Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Data.DataSetExtensions/v4.0_4.0.0.0__b77a5c561934e089/System.Data.DataSetExtensions.dll----------------------------------------UIAutomationProvider Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/UIAutomationProvider/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationProvider.dll----------------------------------------UIAutomationTypes Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/UIAutomationTypes/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationTypes.dll----------------------------------------Microsoft.VisualBasic Assembly Version: 10.0.0.0 Win32 Version: 11.0.50709.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll----------------------------------------SQLDatabaseExplorer Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///D:/Projects/LOBSAPSolution/SQLDatabaseExplorer/SQLDatabaseExplorer/bin/Debug/SQLDatabaseExplorer.EXE----------------------------------------System.Runtime.Remoting Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.34108 built by: FX45W81RTMGDR CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll----------------------------------------Accessibility Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll----------------------------------------WindowsBase Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18060 built by: FX45RTMGDR CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll----------------------------------------System.Xaml Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.18015 built by: FX45RTMGDR CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xaml/v4.0_4.0.0.0__b77a5c561934e089/System.Xaml.dll----------------------------------------System.Transactions Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll----------------------------------------System.EnterpriseServices Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.EnterpriseServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.EnterpriseServices.dll----------------------------------------System.Numerics Assembly Version: 4.0.0.0 Win32 Version: 4.0.30319.17929 built by: FX45RTMREL CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll----------------------------------------