When I run the following code (VB.Net) I get the error message: key not found Parameter name: key when I try to attach the [Grid] to a [Tab]
Is this a "key" property with the [Grid] or with the [Tab] that it resides on?
I'm dynamically adding the [Tab] and the [Grid] at runtime.
If I insert a [Grid] on a [Tab] at design and run similar code to load my data, I do not get this error message.
What have I missed?
==================================================================
'.....................................
'------------------------------------
Grid1 = New UltraWinGrid.UltraGrid
.DataSource = osvgGroupDataSet
.DisplayLayout.Appearance.BackColor = Color.White
.DisplayLayout.Appearance.BorderColor = Color.DarkGray
.DisplayLayout.Appearance.Key = "Tab2"
.DisplayLayout.Bands(0).HeaderVisible = True
.DisplayLayout.Bands(0).Header.Caption = "OptiSave Report"
.DisplayLayout.Bands(0).AutoPreviewEnabled = True
.DisplayLayout.AutoFitStyle = UltraWinGrid.AutoFitStyle.ResizeAllColumns
.DisplayLayout.ScrollBounds = UltraWinGrid.ScrollBounds.ScrollToFill
.DisplayLayout.ScrollStyle = UltraWinGrid.ScrollStyle.Immediate
.DisplayLayout.Override.AllowRowFiltering = DefaultableBoolean.True
.Dock = DockStyle.Fill
End With
UltraTabControl1.Tabs(ActiveTabName).TabPage.Controls.Add(Grid1)
Grid1.Refresh()
Thanks ahead of time.
That error usually means you are trying to refer to an object in a collection by a key that does not exist in the collection. My guess is that your UltraTabControl does not have a tab whose key is ActiveTabName.
Hi Mike,
I saw the above thread. I am also getting the same error. Please, find the error trace below. Need your help in this.
Error: Exception Caught: Key not found Parameter name: key
at Infragistics.Shared.KeyedSubObjectsCollectionBase.GetItem(String key) at Infragistics.Win.UltraWinToolbars.ToolsCollectionBase.get_Item(String key) at Allscripts.TouchWorks.Common.PanelOrderViewer.UpdateButtonsState() at Allscripts.TouchWorks.Common.PanelOrderViewer.OnLoad(EventArgs e) at System.Windows.Forms.UserControl.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.ControlCollection.Add(Control value) at Allscripts.TouchWorks.Common.Viewer.SetDisplayItem(BusinessObject oItem) at Allscripts.TouchWorks.Common.TWWorkspace.ShowViewer(Boolean bNewWindow) at Allscripts.TouchWorks.Workspace.ChartViewer.ChartViewerControl.m_ToolbarsManager_ToolClick(Object sender, ToolClickEventArgs e) at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.OnToolClick(ToolClickEventArgs e) at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.FireEvent(ToolbarEventIds id, EventArgs e) at Infragistics.Win.UltraWinToolbars.ToolBase.OnToolClick() at Infragistics.Win.UltraWinToolbars.ToolMenuItem.OnClick() at Infragistics.Win.UltraWinToolbars.PopupMenuItemUIElement.DoClickProcessing(MouseEventArgs e) at Infragistics.Win.UltraWinToolbars.PopupMenuItemUIElement.OnMouseUp(MouseEventArgs e) at Infragistics.Win.UIElement.OnMouseUp(MouseEventArgs e) at Infragistics.Win.TextUIElementBase.OnMouseUp(MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseUpHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseUp(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseUp(MouseEventArgs e) at Infragistics.Win.UltraWinToolbars.PopupControlBase.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) 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)
Assembly Name: Infragistics.Shared.KeyedSubObjectsCollectionBase Assembly File: Infragistics2.Shared.v9.2.dll Assembly Version: 9.2.20092.2042 Assembly Path: C:\WINDOWS\assembly\GAC_MSIL\Infragistics2.Shared.v9.2\9.2.20092.2042__7dd5c3163f2cd0cb\Infragistics2.Shared.v9.2.dll .NET Version: v2.0.50727
Hi,
This error message indicates that something in your code is trying to reference an object in a collection using a key that does not exist.
From the Call Stack, it appears that you are handling the ToolClick event of a tool in UltraToolbarsManager and which calls intothis method.
Allscripts.TouchWorks.Workspace.ChartViewer.ChartViewerControl.m_ToolbarsManager_ToolClick(Object sender, ToolClickEventArgs e)
And this code is ultimately trying to reference a tool with a non-existant key when it gets to this method:
at Allscripts.TouchWorks.Common.PanelOrderViewer.UpdateButtonsState()
I am facing the same problem refer below trace.
Error is
Key Not Found
Parameter Name:key
at Infragistics.Shared.KeyedSubObjectsCollectionBase.GetItem(String key) at Infragistics.Win.UltraWinGrid.ColumnsCollection.get_Item(String key) at Project_Name.frmMain.ugVisitIDList_InitializeLayout(Object sender, InitializeLayoutEventArgs e) at Infragistics.Win.UltraWinGrid.UltraGrid.OnInitializeLayout(InitializeLayoutEventArgs e) at Infragistics.Win.UltraWinGrid.UltraGrid.FireEvent(GridEventIds id, EventArgs e) at Infragistics.Win.UltraWinGrid.UltraGridLayout.ApplyLoadedBands() at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated(BindingManagerBase bindingManager) at Infragistics.Win.UltraWinGrid.UltraGridLayout.ListManagerUpdated() at Infragistics.Win.UltraWinGrid.UltraGridBase.Set_ListManager(Object newDataSource, String newDataMember) at Infragistics.Win.UltraWinGrid.UltraGridBase.set_DataSource(Object value) at Project_Name.frmMain.btnGenerateList_Click(Object sender, EventArgs e)