in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Error in C1TrueDBDropdown - using MS Interop Forms Toolkit

Last post 05-27-2008 4:14 AM by PeterHelman. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-15-2007 4:25 AM

    Error in C1TrueDBDropdown - using MS Interop Forms Toolkit

     

    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

  • 03-06-2008 1:00 PM In reply to

    Re: Error in C1TrueDBDropdown - using MS Interop Forms Toolkit

    I am having the same problem, did you manage to find a solution? 

  • 05-27-2008 4:14 AM In reply to

    Re: Error in C1TrueDBDropdown - using MS Interop Forms Toolkit

     Hi GoChris,

     Unfortunately we cant get the dropdown to work and C1 have stated that the Interop with VB6 is not supported by them.

    We made a workaround where the user can doubleclick in the cell , and have a listbox show and choose a value from there ..

    It works but it's hopefully a temporary solution, but we dont have time in the current project to find it :/

    /Peter Hallengreen
     

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.