Hello,
I am having an issue getting the Shortcutbar to display using c# on my IGGrid. If I set GroupingKey to any value it cashes the program to crash without any exception or information. I figure I am just mising somethign simple, but my code matches all the examples I have found.
IGGridViewImageColumnDefinition imgcol = new IGGridViewImageColumnDefinition ("Image", IGGridViewImageColumnDefinitionPropertyType.IGGridViewImageColumnDefinitionPropertyTypeImage); imgcol.HeaderText = "Item"; imgcol.HeaderTextAlignment = UITextAlignment.Center; imgcol.CacheImages = true; imgcol.ContentMode = UIViewContentMode.ScaleAspectFit; imgcol.Width = IGColumnWidth.CreateNumericColumnWidth (75f); var items = await InventoryService.GetNSItems (); _dsh = new IGGridViewDataSourceHelper (); _dsh.AutoGenerateColumns = false; //_dsh.WeakLoadMoreDelegate = new LoadMore (_grid); _dsh.Data = items.ToArray(); _dsh.FilteringKey = "SearchString"; _dsh.FilterType = IGGridViewFilterConditionType.IGGridViewFilterConditionTypeStringContains; _dsh.ColumnDefinitions.Add (imgcol); IGGridViewColumnDefinition col = new IGGridViewColumnDefinition ("DisplayDescription"); col.HeaderText = "Description"; col.HeaderTextAlignment = UITextAlignment.Center; _dsh.ColumnDefinitions.Add (col); _dsh.GroupingKey = "GlItemCode"; _dsh.DisplayShortcutbar = true; _grid = new IGGridView(new CoreGraphics.CGRect(0,100, this.View.Frame.Size.Width, this.View.Frame.Size.Height), IGGridViewStyle.IGGridViewStyleDefault); _grid.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; _grid.SelectionType = IGGridViewSelectionType.IGGridViewSelectionTypeNone; _grid.SwipeRowAction = IGGridViewSwipeRowAction.IGGridViewSwipeRowActionManualSlideLeft; _grid.WeakDelegate = new MyDelegate(this); _grid.FilterAction = IGGridViewFilterAction.IGGridViewFilterActionImmediate; _grid.HeaderHeight = 0; _grid.DataSource = _dsh; this.View.AddSubview(_grid);
Thanks
Ryan
Hello Ryan,
Attached is my test sample
Looking at your source I would think that the issue is that the grouping key isn't set to the export key for the property. If you look at the test sample my property is named "Field2" but it's export key is "field2". The group key would need to be set to "field2" so that it works when it's on the iOS side.
Please try it out and let me know. If you still can't get it, can you modify the sample to show the behavior. The only time I got an exception out was when the property wasn't set to a valid property name
Darrell
I am still having the same issue after updating my export values.
In my Viewcontroller,
_dsh.GroupingKey = "glitemcode"; _dsh.DisplayShortcutbar = true;
In my InventoryNS class
[Export("glitemcode")] public string GlItemCode { get; set; }
Is there something else I need to change?
Thanks,
Without being able to reproduce the issue, it's difficult to say what might be causing it.
Did you run the trial app provided? Did that work? Can you modify that sample (or make a similar small sample) that demonstrates the issue so that it can be debugged.
The sample app worked great. I can't reproduce it in a test app and so there isn't a good way to show you the issue. I am using the filtering by searching and that will be enough for now. If I find a real issue I will post it back here.
Thank you for the help.