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.
Thanks Mike :)..I will look in to that ..
Hi Lava,
This exception indicates that you are trying to reference a Cell in the grid using a Key of a column that does not exist. You should probably check out that code and see why you are doing that. Maybe it's an unbound column and you are trying to access the cell before that column was added? If so, then a simple solution would be to use the Exists method to make sure the cell is there before you try to access it, just as I did in the sample code above.
Hi Mike ,
i have similar issue ,pls help me in this regard.
Client Handler ID:5968c4ff-38ce-4d7c-9c9b-69ea98eacb6b---------------------------------------------------------------------------------------------------Exception Message:Key not found: 'TYPE_KEY'Parameter name: key---------------------------------------------------------------------------------------------------Stack Trace: 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 SearchEditEntityView.SelectedRow() at SearchEditEntityView.SearchGrid_DoubleClickRow(Object sender, DoubleClickRowEventArgs e) at Infragistics.Win.UltraWinGrid.UltraGrid.OnDoubleClickRow(DoubleClickRowEventArgs e) at Infragistics.Win.UltraWinGrid.UltraGrid.FireEvent(GridEventIds id, EventArgs e) at Infragistics.Win.UltraWinGrid.GridCellEmbeddableEditorOwnerInfoBase.OnEditorDoubleClick(EmbeddableUIElementBase embeddableElem, EmbeddableClickEventArgs e) at Infragistics.Win.EmbeddableUIElementBase.RaiseDoubleClickEvent(UIElement sender, Boolean isButton) at Infragistics.Win.EmbeddableUIElementBase.OnDoubleClick(Boolean adjustableArea) at Infragistics.Win.UIElement.OnDoubleClick(Boolean adjustableArea) at Infragistics.Win.ControlUIElementBase.ProcessDoubleClick(Object sender, EventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnDoubleClick(EventArgs 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)
Nothing to it:
if (this.popupPrintFax.Tools.Exists("btnPrintReq")) this.popupPrintFax.Tools["btnPrintReq"].SharedProps.Enabled = false;
Hi Mike,Thanks for the quick response. So, do I need to check for the existence for the following:
this.popupPrintFax.Tools["btnPrintReq"].SharedProps.Enabled = false;this.popupPrintFax.Tools["btnFaxReq"].SharedProps.Enabled = false;this.popupPrintFax.Tools["btnPrintRes"].SharedProps.Enabled = false;this.popupPrintFax.Tools["btnFaxRes"].SharedProps.Enabled = false;
Could you give me a sample Psuedocode for this.