Our setup is a .NET Interop Forms UserControl , with the grid and dropdown.
This Interop UserControl is placed on a VB6 form, and everything works fine , except that the error occurs when we use the dropdownbox.
We are currently using C1.Win.C1TrueDBGrid.2 --- v2.0.50727
Our application used the TDBGrid, and we get this error when trying to use the dropdown-feature in the grid :
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at C1.Win.C1TrueDBGrid.DropDownForm.a(C1TrueDBDropdown A_0, Form A_1, Point A_2)
at C1.Win.C1TrueDBGrid.BaseGrid.View.a(C1TrueDBDropdown A_0)
at C1.Win.C1TrueDBGrid.BaseGrid.View.bc()
at C1.Win.C1TrueDBGrid.BaseGrid.View.handleButton(Point p)
at C1.Win.C1TrueDBGrid.Split.handleButton(Point p)
at C1.Win.C1TrueDBGrid.BaseGrid.View._OnClickCurrent(Point p)
at C1.Win.C1TrueDBGrid.Split._OnClickCurrent(Point p)
at C1.Win.C1TrueDBGrid.BaseGrid.View.OnClick(Point p)
at C1.Win.C1TrueDBGrid.Split.OnClick(Point p)
at cd.b(Point A_0)
at C1.Win.C1TrueDBGrid.BaseGrid.Frame.doClick(EventArgs e)
at C1.Win.C1TrueDBGrid.C1TrueDBGrid.doClick(EventArgs e)
at C1.Win.C1TrueDBGrid.BaseGrid.Frame.OnClick(EventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at C1.Win.C1TrueDBGrid.BaseGrid.Frame.WndProc(Message& m)
at C1.Win.C1TrueDBGrid.C1TrueDBGrid.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)
We have tried both versions below, who produce the same error :
- - - - - - VERSION 1 - - - - - - - -
column.DataColumn.ValueItems.Values.Clear()
Dim dc As New C1.Win.C1TrueDBGrid.ValueItem("a", "a")
column.DataColumn.ValueItems.Values.Add(dc)
dc = New C1.Win.C1TrueDBGrid.ValueItem("b", "b")
column.DataColumn.ValueItems.Values.Add(dc)
column.DataColumn.ValueItems.Translate = True column.DataColumn.ValueItems.Presentation = C1.Win.C1TrueDBGrid.PresentationEnum.ComboBox
- - - - - - VERSION 2 - - - - - - - -
Dim dc As New C1.Win.C1TrueDBGrid.C1DataColumn("test", "PARAMETERNAME", GetType(String)) column.DataColumn.DropDown = C1TrueDBDropDown1
C1TrueDBDropDown1.Columns.Add(dc)
C1TrueDBDropDown1.DropdownWidth = C1.Win.C1TrueDBGrid.DropdownWidthEnum.Column
C1TrueDBDropDown1.Width = C1TrueDBDropDown1.DropdownWidth C1TrueDBDropDown1.HScrollBar.Style = C1.Win.C1TrueDBGrid.ScrollBarStyleEnum.None
C1TrueDBDropDown1.VScrollBar.Style = C1.Win.C1TrueDBGrid.ScrollBarStyleEnum.None
C1TrueDBDropDown1.ValueMember = "PARAMETERNAME"
C1TrueDBDropDown1.DataSource = ds.Tables(0)
Really hope you can help
A code sample can be mailed , to reproduce the error. Aprox 5 MB
/Peter Hallengreen