This is a migrated thread and some comments may be shown as answers.

RadPropertyGrid doesn't work in Labview

7 Answers 361 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 25 Apr 2016, 06:30 AM

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

7 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 27 Apr 2016, 02:03 PM
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.
0
Peter
Top achievements
Rank 1
answered on 27 Apr 2016, 02:36 PM

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

 

0
Peter
Top achievements
Rank 1
answered on 27 Apr 2016, 02:39 PM

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

0
Peter
Top achievements
Rank 1
answered on 27 Apr 2016, 09:58 PM

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

 

0
Hristo
Telerik team
answered on 28 Apr 2016, 02:53 PM
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.
0
Peter
Top achievements
Rank 1
answered on 28 Apr 2016, 04:38 PM

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

0
Hristo
Telerik team
answered on 29 Apr 2016, 12:38 PM
Hello Peter,

Thank you for writing back.

The Parent property is actually inherited from the System.Windows.Forms.Control class and its default implementation 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.
Tags
PropertyGrid
Asked by
Peter
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Peter
Top achievements
Rank 1
Share this question
or