Error with ISubEditor

Posted by: ranjani-fp on 8 September 2017, 1:58 pm EST

  • Posted 8 September 2017, 1:58 pm EST

    Spread deactivates the parent control while displaying Customcelltype and combocelltype. I tried to display the form in floating mode, when the form is on floating mode these cell types are not behaving properly as expected. custom cell type is not focused and displayed. combo cell type dropdown visible always. Please provide me the solution for this? What should be the parent for these controls on display?

  • Replied 8 September 2017, 1:58 pm EST

    <FONT color=#000000>I am using <FONT size=2>Infragistics.Win.UltraWinTabbedMdi.</FONT><FONT size=2>UltraTabbedMdiManager control from Infragistics. This control gives the tabbed layout and its parent form is a MdiContainer. The control within the tab is the MDI child. If I change the control properties as MdiParent = null and Owner = mainform ie. MdiContainer.The Custom editor cell within the control is not  behaving properly. while showing the subeditor it deactivates the control ie its parent. Could you please let me know the dependencies for the SubEditor?</FONT></FONT>
  • Replied 8 September 2017, 1:58 pm EST

    Sorry, I am not sure what you mean by floating mode. Do you have a small test project that shows this?
  • Replied 8 September 2017, 1:58 pm EST

    I am not using the customized comboboxCellType, simply using the Farpoint provided ComboboxCellType. <FONT size=2>

    The problem is with FarPoint.Win.Spread.CellType.<FONT color=#008080 size=2>ComboBoxCellType.

    </FONT></FONT>
  • Replied 8 September 2017, 1:58 pm EST

    Hello,


    I am not sure what might be causing the issue you are seeing. I would suggest creating a small sample project reproducing this behavior by creating a form with a Spread that has your custom class ComboboxCellType. If this reproduces the issue, then we can debug what you are doing in your custom class that may be causing the issue you are seeing.

  • Replied 8 September 2017, 1:58 pm EST

    Thanks for the reply. I need one more clarification. Its working fine normally.  But in some cases the problem occurs. The dropdown of the Combobox celltype is displayed but not closed and the Combo box events are not triggered after that. Could you please provide me the causes for this? I will try to fix accordingly since my project size is very large I am not abe to provide the sample.
  • Replied 8 September 2017, 1:58 pm EST

    Hello,

    I am not aware of  <font color="#000000"><font size="2">Infragistics.Win.UltraWinTabbedMdi.</font><font size="2">UltraTabbedMdiManager functionality, how custom sub editor works in this control. However It is really simple to create your own SubEditor using Far Point Spread for  Windows Forms.You just need to Implement ISubEditor Interface to the Form and Set the Subeditor Property to the caller.You may have a look at the sample that was shipped along with the Spread named SpreadWinDemo, refer to Custom SubEditor part for more information.</font></font>

     

    Thanks,

     

     

  • Replied 8 September 2017, 1:58 pm EST

    Hello Ranjani, 

    Please try implementing F<span class="Apple-style-span" style="font-family:Tahoma;">arPoint.Win.Spread.CellType.<font color="#008080" size="2">ComboBoxCellType <span class="Apple-style-span" style="font-family:Arial;">in a fresh project without using Infragistics controls and let me know if the issue still persists.</span></font></span>

    Regards, 

  • Replied 8 September 2017, 1:58 pm EST

    Hello,


    I have been trying to reproduce this issue but have not. Are you turning off the MDI relationship while the application is running? How are you doing this? There should not be any time where the dropdown list gets seperated from the editor of the cell and not be able to be closed, so there is not anything I can suggest to look for without being able to debug into the issue.

  • Replied 8 September 2017, 1:58 pm EST

    Hello,

    I don't think Activating/Deactivating a Form may cause any issues with SubEditor and ComboBox cell.

    I tried with Two forms, Form1 and Form2

    Form2 contains a Spread with a ComboBox Cell, when activating/deactivating Form2 from Form1, I don't see any problem with ComboBox cell.

     

    Thanks,

     

  • Replied 8 September 2017, 1:58 pm EST

    If <FONT size=2>Activated/</FONT><FONT size=2>Deactivate event triggered continuously for a Form, Will that create any problem with SubEditor and ComboBox cell?</FONT>
  • Replied 8 September 2017, 1:58 pm EST

    I didn't face any issues normally, but in some cases the problem occurs. For Example: I am using Mainform as MdiContainer and the form that the spread exists is the MdiChild. In this case ComboBoxCellType works Properly. If I change the MdiParent = null and by setting the Owner of the form to the mainform I am facing the problem. I am facing this in my project only. If I create the sample it is working properly. It would be great if you provide the causes for this.
  • Replied 8 September 2017, 1:58 pm EST

    Ranjani,

    The error you are receiving, when an object is not being instantiated with NEW keyword or when a variable is used in code, but that variable doesn't contain a reference to any object in memory(there are other causes as well).You may review your code to check for the same.You can also send across a sample zipped project for us to debug.

    Thanks

  • Replied 8 September 2017, 1:58 pm EST

    I set the MdiParent = null for the form while the application is running. After the dropdown list separated from the editor of the cell, any key operation on the dropdownlist generate this error :-


     System.NullReferenceException: Object reference not set to an instance of an object.
       at FarPoint.Win.FpCombo.a(Object A_0, KeyEventArgs A_1)
       at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
       at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
       at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
       at System.Windows.Forms.Control.WmKeyChar(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ListBox.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)

  • Replied 8 September 2017, 1:58 pm EST

    Im my example I provided OnActivated event is triggered. Is this possible to stop this event fire?


    Steps to reproduce :-


    1. Click Button1


    2. Click Button2


    3. Select the Combobox which trigger Activated event.


    Any possible solution for this. I am not able to change the code in Activated Event.


    2009/08/SampleProject1.zip
  • Replied 8 September 2017, 1:58 pm EST

    While selecting the combobox value, Onactivated event of the form is triggered. In my code within this event, I have called spread.focus which in turn trigger EditingControl focus which creates me the problem. Can you advice to resolve this? I want to disable EditingControl.focus Is there any possible way exists?

  • Replied 8 September 2017, 1:58 pm EST

    Ranjani,

    Could you please send us a zipped sample project replicating the said issue along with the steps to replicate the same at our side ?

    Thanks

  • Replied 8 September 2017, 1:58 pm EST

    I am getting this exception while selecting the ComboBoxcell value,


    System.NullReferenceException was unhandled
      Message="Object reference not set to an instance of an object."
      Source="FarPoint.Win"
      StackTrace:
           at FarPoint.Win.SuperEditBase.get_Focused()
           at System.Windows.Forms.Control.FocusInternal()
           at System.Windows.Forms.Control.Focus()
           at FarPoint.Win.ElementControl.Focus(Boolean giveFocus)
           at FarPoint.Win.FpCombo.ShowList(Boolean bShow)
           at FarPoint.Win.FpCombo.a(Object A_0, MouseEventArgs A_1)
           at System.Windows.Forms.Control.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.ListBox.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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
           at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
           at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(ApplicationContext context)
           at Mesh.Gui.Application.ApplicationManager.Run() in C:\Working\Mesh\main\Gui.Application\ApplicationManager.cs:line 823
           at Mesh.Start.Start.StartApplication(String[] arguments) in C:\Working\Mesh\main\Start\Start.cs:line 186
           at Mesh.Start.Start.Main(String[] arguments) in C:\Working\Mesh\main\Start\Start.cs:line 37
           at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()


    Any solution for this?

  • Replied 8 September 2017, 1:58 pm EST

    If the Activated event called 'n' number of times in the background thread, Will that create any problem with SubEditor dispaly?
  • Replied 8 September 2017, 1:58 pm EST

    Hello,


    There is not a way to keep the onActivated event of the form from firing because of the way the dropdown of the combobox celltype is created. It is a seperate window that is created and then posistioned over the Spread in the correct location. The same happens when you use a standard combobox control on a form.

  • Replied 8 September 2017, 1:58 pm EST

    Ranjani,

    Without looking into the code or a sample it would be difficult to give you a definite solution for this.Could you please check the Form's activated event and see if it is being caused by opening the combobox and if it is then not to set the focus on Spread. If the control with focus is Spread then not to run the code.

    Thanks

  • Replied 8 September 2017, 1:58 pm EST

    Hello,


    I do not have the details on how these events are fired exactly. When you open a combobox dropdown, the ComboDropDown event will fire. Then, the dropdown list is created as a seperate popup form. In version 3 of Spread, this caused the main form to deactivate and so a bug was reported because customers did not like having the main form look deactivated when opening a combobox. We fixed the bug by reactivating the main form. This is causing the FormActivated event to fire. I think if you set some flag in the ComboDropDown event, you can use this flag to skip your code in the FormActivated event from executing.

  • Replied 8 September 2017, 1:58 pm EST

    Could you please provide me the following details?


    1. When and how Form_Activated event triggered after combobox creation


    2. When CancelEditing method triggered while losing focus


    I am using the Form as a Container by implementing IContainer interface. If the form used as a MdiForm, Container.Activated event is not triggered instead base form activate event triggered. When the form used as a Non-MdiForm Container.Activated event triggered.


    If I get the details of event trigger that would be very helpful. Thanks for your reply.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels