|
|||||||||||||
07-04-2012 03:34 PM
Hi all,
I am using Net Measurement Studio in C# and I would like to know how can I host a PropertyEditor (for example, LineStyle as property for a plot object) in a DataGridView cell. Is it possible? how can I achieve this?
Thanks.
Solved! Go to Solution.
08-13-2012 05:04 AM
Hi,
I have hosted a PropertyEditor into a datagridviewcolumn as a custom cell following the below approach:
http://msdn.microsoft.com/en-us/library/7tas5c80.a
but when my datagridview is loaded (columns/rows created), cell of type PropertyEditor are not visible until you do double-click. Also after double click below error is generated inmediatelly (in this case I have a propertyeditor whose source is object=ScatterPlot, propertyName=LineStep.
Error Details:
The type initializer for 'NationalInstruments.UI.Internal.WaveformPlotEleme
Stack Trace:
at NationalInstruments.UI.Internal.WaveformPlotElemen
at NationalInstruments.UI.WaveformPlot.CreateElement(
at NationalInstruments.UI.ControlEntity..ctor()
at NationalInstruments.UI.Plot..ctor()
at NationalInstruments.UI.CartesianPlot..ctor()
at NationalInstruments.UI.XYPlot..ctor()
at NationalInstruments.UI.XYPlot..ctor(XAxis xAxis, YAxis yAxis)
at NationalInstruments.UI.WaveformPlot..ctor(XAxis xAxis, YAxis yAxis)
at NationalInstruments.UI.Internal.Design.LineStepEdi
at NationalInstruments.Internal.Design.PreviewDropDow
at NationalInstruments.Internal.Design.PreviewDropDow
at NationalInstruments.UI.WindowsForms.PropertyEditor
at System.Windows.Forms.Control.PaintWithErrorHandlin
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O
at System.Windows.Forms.Control.ControlNativeWindow.W
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I am trying to solve two issues:
1) Why custom PropertyEditor cell is not visible?
2) Why after doubleclick on cell it crashes with the above message?
Thanks.
08-13-2012 03:45 PM
By adding useLegacyV2RuntimeActivationPolicy="true" to app.config file in the project solved it.
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
My Profile | Privacy |
Legal |
Contact NI
© 2011 National Instruments Corporation. All rights reserved. | E-Mail this Page
|
||

E-Mail this Page