Hello,
IG.Unified.dll and IGChart.Unified.dll (12/15/2014) did work with actual Xamarin BETA version at 12/18/2014
but does not work with actual Xamarin STABLE version.
Code sample:
nfloat width = 150;
col.Width = IGColumnWidth.CreateNumericColumnWidth(width);
produces a System.Exception:
Failed to marshal the Objective-C object 0x7a0a2f80 (type: IGColumnWidth).
Could not find an existing managed instance for this object, nor was it possible to create
a new managed instance (because the type 'Infragistics.IGColumnWidth' does not have a constructor that takes one IntPtr argument).
at ObjCRuntime.Runtime.MissingCtor (IntPtr ptr, IntPtr klass, System.Type type, MissingCtorResolution resolution) [0x00046] in
/Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.iOS.cs:392
at ObjCRuntime.Runtime.ConstructNSObject[IGColumnWidth] (IntPtr ptr, System.Type type, MissingCtorResolution missingCtorResolution) [0x0002a] in
/Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.iOS.cs:415
at ObjCRuntime.Runtime.GetNSObject[IGColumnWidth] (IntPtr ptr) [0x000c1] in
/Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.iOS.cs:521
at Infragistics.IGColumnWidth.CreateNumericColumnWidth (nfloat width) [0x00000] in <filename unknown>:0
Thans for helping
Johann
Hi Johann,
I tested the following lines of code using Xamarin Studio 5.5.4-5.7 and did not encounter any exceptions.
nfloat width = 150; IGColumnWidth columnWidth = IGColumnWidth.CreateNumericColumnWidth(width);
Would you be able to attach a sample to your next reply that causes an exception with the code you mentioned? Additionally, you may want to place your IGColumnWidth instance into a instance variable so there is no chance it would get released before assigning the Width property of IGGridViewColumnDefinition.
Hi Torrey,
i can provide you a sample on our server. Here is the link: https://www.hidrive.strato.com/lnk/wEmIGLCS
Test.zip contains an adjusted Xamarin Popovers Sample with IG.Unified.dll which leads to an Exception using it:
Tap on “Tap” and the mentioned exception is thrown:
2015-01-09 10:44:48.707 Popovers[1728:35392] System.Exception: Failed to marshal the Objective-C object 0x18dd8550 (type: IGColumnWidth). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'Infragistics.IGColumnWidth' does not have a constructor that takes one IntPtr argument).
at ObjCRuntime.Runtime.MissingCtor (IntPtr ptr, IntPtr klass, System.Type type, MissingCtorResolution resolution) [0x00046] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.iOS.cs:392
at ObjCRuntime.Runtime.ConstructNSObject[IGColumnWidth] (IntPtr ptr, System.Type type, MissingCtorResolution missingCtorResolution) [0x0002a] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.iOS.cs:415
at ObjCRuntime.Runtime.GetNSObject[IGColumnWidth] (IntPtr ptr) [0x000c1] in /Developer/MonoTouch/Source/maccore/src/ObjCRuntime/Runtime.iOS.cs:521
at Popovers.DetailViewController.ShowPopover (Foundation.NSObject sender) [0x00015] in /Users/gdo/Samples/TEST/DetailViewController.cs:125
In DetailsViewController.cs:
public void ShowPopover (NSObject sender) { // Set the sender to a UIButton. UIButton tappedButton = (UIButton)sender; // for TEST // Present the popover from the button that was tapped in the detail view. //DetailViewPopover.PresentFromRect (tappedButton.Frame, View, UIPopoverArrowDirection.Any, true); try { nfloat width = 150; IGColumnWidth columnWidth = IGColumnWidth.CreateNumericColumnWidth (width); Console.WriteLine (columnWidth.ToString ()); } catch (Exception e) { Console.WriteLine (e); } // Set the last button tapped to the current button that was tapped. LastTappedButton = sender; }
Thanks,