Problems with V 4.22

Nov 26, 2009 at 1:57 AM

Hi,

sorry for my english, but I need  help ;-).

1)

I have download the last Version 4.22.3616.29532. But where is the property Selection.BackColor; Selection.Border, Selection.FocusBackColor ?

If i use this version 4.22.3606.15103,  i can find this properties.

2)

I have a grid control on a form. If i click on this grid the form must be closed, but there is a error.

 

 Private Sub DataGridView1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGridView1.MouseClick

     Me.Close()

End Sub

System.ObjectDisposedException wurde nicht behandelt.
  Message="Auf das verworfene Objekt kann nicht zugegriffen werden.\r\nObjektname: Grid."
  Source="System.Windows.Forms"
  ObjectName="Grid"
  StackTrace:
       bei System.Windows.Forms.Control.CreateHandle()
       bei System.Windows.Forms.Control.get_Handle()
       bei System.Windows.Forms.Control.PointToClientInternal(Point p)
       bei System.Windows.Forms.Control.PointToClient(Point p)
       bei SourceGrid.GridVirtual.OnMouseClick(MouseEventArgs e)
       bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       bei System.Windows.Forms.Control.WndProc(Message& m)
       bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.Run(ApplicationContext context)
       bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       bei WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.
       bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ThreadHelper.ThreadStart()
  InnerException:


Thank you :-)

Michael



 

 

 

Coordinator
Nov 26, 2009 at 8:56 AM

1. You must cast grid.Selection to SelectionBase class to access these properties.

This is because i extracted interface IGridSelection from SelectionBase

 

Nov 26, 2009 at 12:05 PM

Wow, thanks for this fast support.  Now it works :-)

Have you an idea for my problem 2 ?

Thank you very much

Michael

 

 

Coordinator
Nov 26, 2009 at 1:37 PM

I don't know. It may have to do something with threading, if you use threads.   Too little information to be able to understand.

Nov 26, 2009 at 2:43 PM

Thanks for you reply,

no, i dont use threads. here, you can try it. Its all. If you click on this grid, there is the error, i posted before.

Imports SourceGrid

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim nGrid As New SourceGrid.Grid

        AddHandler nGrid.MouseClick, AddressOf Grid_MouseClick

        nGrid.Dock = DockStyle.Fill

        Me.Controls.Add(nGrid)

    End Sub

    Private Sub Grid_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)

        Me.Close()

    End Sub

End Class

Thank you, for you help.

Michael