RadPropertyGrid doesn't work in Labview

8 posts, 0 answers
  1. Peter
    Peter avatar
    5 posts
    Member since:
    Jan 2016

    Posted 25 Apr Link to this post

    Hi,

    Labview has a .NET Container to host .Net Windows Forms Controls *)

    I make a simple Example with  2 .NET Containers for RadPropertyGrid  and PropertyGrid .

    And assign a new instance of Printdialog of System.Windows.Forms to SelectedObject.

    I thought I could replace the PropertyGrid  with RadPropertyGrid  (more features,  modern look), but RadPropertyGrid doesnt work.

    What could be the problem?

    I attached also the simple Labview 2015 vi (rename PropGrid.vi.gif to PropGrid.vi)

    Peter

    *) see an complex Example with Datagridview: https://github.com/unipsycho/LabVIEWdotNetDataGrid

  2. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 27 Apr Link to this post

    Hi Peter,

    Thank you for writing.

    I am not familiar with the LabView platform, so could you please explain in details what I need to set up on my end in order to test your scenario.

    I also tested the RadPropertyGrid control with a standard .Net PrintDialog and it displayed all of its properties. This behavior indicates that the issue might be specific to the environment in which you are working.

    I hope this helps. Looking forward to your reply.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Peter
    Peter avatar
    5 posts
    Member since:
    Jan 2016

    Posted 27 Apr in reply to Hristo Merdjanov Link to this post

    Hi Hristo,

    you need Labview: http://www.ni.com/download-labview/

    Than you can debug your Libraray with RadPropertyGrid by enter the Path to Labview exe in the Debug Property Page, Start external programm:  "c:\Program Files (x86)\National Instruments\LabVIEW 2015\LabVIEW.exe" . Labview called at first the Contructor RadPropertyGridby loading it in the .Net Container at the front panel. You should set the breakpoint inside the Set accessor of SelectedObject Property. It is called if you run the vi.

     

    Possible there is a Debugging problem with Shadow Copying
    http://digital.ni.com/public.nsf/allkb/F1236C50E9F3D7E68625714F0065E756  :

    When LabVIEW calls a .NET assembly, it enables a .NET feature called Shadow Copying.
    To disable this feature in LabVIEW 2011 or later, add the INI flag AppDomainSetup_ShadowCopyFiles=False to the LabVIEW.ini file located in the labview directory.

    Inside a standard Windows Forms Application there are no problems. But the standard .NET PropertyGrid can also called from Labview. Possible RadPropertyGrid call special properties of the Application Assembly, which are not supported in Labview?

    Your Raddock control has no problems inside a Labview .NET Container. See example: https://decibel.ni.com/content/docs/DOC-46494

    Thanks,

    Peter

     

  5. Peter
    Peter avatar
    5 posts
    Member since:
    Jan 2016

    Posted 27 Apr in reply to Peter Link to this post

    Direct Download Link: http://download.ni.com/support/softlib/labview/labview_development_system/2015/2015LV-WinEng.exe

  6. Peter
    Peter avatar
    5 posts
    Member since:
    Jan 2016

    Posted 27 Apr in reply to Peter Link to this post

    RadPropertyGrid has a Parent property. In a Windows Forms Parent is set to the Form.

    But in the Labview .NET Container it is not set.

    This can be solved by a UserControl which contain the RadPropertyGrid:

    public class RadPropGridControl : UserControl {        public RadPropertyGrid radPropertyGrid;        public RadPropGridControl() {            this.radPropertyGrid = new Telerik.WinControls.UI.RadPropertyGrid();            this.radPropertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;            this.Controls.Add(this.radPropertyGrid);        }    }

    Get radPropertyGrid from Labview and set its SelectedObject Property.

    cheers
    Peter

     

  7. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 28 Apr Link to this post

    Hi Peter,

    Thank you for writing back.

    From your last message, I understand that you have managed to resolve the issue. It indeed appears to be related to the LabView .NET environment.

    Please let me know if you still need assistance on this matter.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  8. Peter
    Peter avatar
    5 posts
    Member since:
    Jan 2016

    Posted 28 Apr Link to this post

    Hi Hristo,

    yes, the problem is solved. But it is not Labview specific. RadPropertyGrid must have the Parent proporty set to a parent control. By adding it with the designer in a form, the designer add the line: this.Controls.Add(this.radPropertyGrid1);

    If I add the RadPropertyGrid by code and don't to set the Parent property nothing is shown.

    Peter

  9. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 29 Apr Link to this post

    Hello Peter,

    Thank you for writing back.

    The Parent property is actually inherited from the System.Windows.Forms.Control class and its default implementation has not been altered. If you create a standard property grid in Visual Studio and do not add it to the Controls collection it will also have its parent property set to null.

    I hope this information helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo Merdjanov
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top
UI for WinForms is Visual Studio 2017 Ready