User Profile & Activity

leo Chandra Member
Page
of 14
Posted: March 23, 2015 10:33 AM

Hi Thomas,

Thanks for your suggestion. Please understand that android grid sample is a "feature sample". Different with "reference sample" that will explore crosslight ability, "feature sample" was intended to demonstrate a spesific feature, in this case is android grid fragment feature, in a simple way. Still, I will forward your suggestion to production team so they will note your suggestion as a consideration.

Best Regards,
Leo

Posted: March 23, 2015 8:26 AM

Hi Thomas,

We have found the problem and have made a hot fix for this. You could get the hot fix here. Please note that this update only applied to Unified API. For information about Unified API migration, please refer to this guide.

Best Regards,
Leo

Hi Leo Hong,

We will investigate about this. Will get back on you as soon as I found any update on this.

Best Regards,
Leo Chandra

Hi Leo Hong,

Please make sure that the View (ex:UILabel) have a valid referencing outlet with the same name as the one you have used in binding provider. If the xib have been configured correctly, the following code should be able to help you binding SectionHeader of UICollectionView:

  1. On binding provider, bind the label on header section using ItemBindingDescription with "Group" TargetBindingType. Example:
  2. itemBinding.AddBinding("TextLabel", BindableProperties.TextProperty, new BindingDescription("Title"), TargetBindingType.Group);
  3. On ViewModel, please make sure that GroupItems never return null but empty List instead. This is useful so BindingProvider could recognize your GroupItems. Example:
  4. public override System.Collections.IEnumerable GroupItems {	get {
    		return (base.GroupItems != null) ? base.GroupItems : new List ();
    	}
    	set {
    		base.GroupItems = value;
    	}
    }
  5. Please set your ViewController to used the defined View and to show Section Header. Example:
  6. public override bool ShowSectionHeader
    {
    	get
    	{
    		return true;
    	}
    }
    public override UIViewTemplate SectionHeaderTemplate
    {
    	get
    	{
    		return new UIViewTemplate(ItemCollectionViewHeader.Nib);
    	}
    }

    note: ItemCollectionViewHeader should inherited from UICollectionReusableView.

That should allow you to bind the views in SectionHeader.

Best Regards,
Leo Chandra

Posted: March 17, 2015 2:29 AM

Hi James,

Sorry for the delay. I have test the sample you have share with slight modification to fit my environment. The following are the step I used in my test:

  1. Restore the database backup to sql server
  2. Modified the connection string.
  3. Run the sample on Internet Explorer
  4. Delete a row above the bottom one
  5. Delete bottom row.
Unfortunately I could not replicate your issue. The row was deleted successfully. I have attach the test record video. Please review it and inform me on anything that I may miss during my test.

Best Regards,
Leo

Posted: March 16, 2015 10:31 AM

Hi Thomas,

Yes. You must add this.RegisterViewIdentifier("EditButton", this.EditButton);
Sorry, I seem I miss it on my answer.

Regarding setting SelectedItems programmatically, there is a work around by implementing this in view controller:

protected override void OnViewModelPropertyChanged(PropertyChangedEventArgs e){
    if(e.PropertyName == "SelectedItems"){
        //Deselected all item in view
        if(this.TableView.IndexPathsForSelectedRows != null)
            foreach(NSIndexPath selectedPath in this.TableView.IndexPathsForSelectedRows){
                this.TableView.DeselectRow(selectedPath, true);
            }
        //Reselect all item based on current SelectedItems on ViewModel
        if(this.ViewModel.SelectedItems != null)
            foreach(DataSamples.Models.Item item in this.ViewModel.SelectedItems){
                var index = this.ViewModel.Items.IndexOf(item);
                var groupIndex = 0;
                if(this.ViewModel.GroupItems != null){
                    bool founded = false;
                    List<CategoryGroup> list = (List<CategoryGroup>)this.ViewModel.GroupItems;
                    for(int i=0;i<list.Count;i++){
                        var groupItem = list[i];
                        for(int j=0;j<groupItem.Count;j++){
                            var tempItem = groupItem[j];
                            if(tempItem == item){
                                index = j;
                                groupIndex = i;
                                break;
                            }
                        }
                        if (founded)
                            break;
                    }
                }
                var indexs = NSIndexPath.FromRowSection(index, groupIndex);
                this.TableView.SelectRow(indexs,true,UITableViewScrollPosition.None);
            }
    }
}
That should do it.


Best Regards,
Leo

Posted: March 16, 2015 7:30 AM

Hi Tomas,

ShowActionBarUpButton not yet supported in FragmentActivity. If you want to used ShowActionBarUpButton, please change the ItemDetail fragment to Activity. I have modified the sample as per thing you have point out. As for slider in the detail view, I will discuss with team to enhance our sample as your suggestion. Thank you for the feedback.

About custom layout, You could set custom layout by overriding "GridItemLayoutId" to the layout you want. The following are an example to used custome layout:

  1. Create a new android layout. example: itemgridlayout with the following content:
    <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="4dp"
        android:clickable="true"
        android:focusable="true">
      <TextView
          android:id="@+id/TextLabel"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="4dp"
          android:gravity="center"
          android:textSize="12sp" />
      <ImageView
          android:id="@+id/ImageView1"
          android:layout_width="100dp"
          android:layout_height="100dp" />
    </LinearLayout>
    

  2. On Activity, please override GridItemLayoutId as the following:
    protected override int GridItemLayoutId
    {
       get
       {
          return Resource.Layout.itemgridlayout;
       }
    }

  3. Don't forget to bind each view of your custom layout. example: (note: itemBinding is ItemBindingDescription)
    itemBinding.AddBinding("TextLabel", BindableProperties.TextProperty, "Name");
    itemBinding.AddBinding("ImageView1", BindableProperties.ImageProperty, "ThumbnailImage");

That should do it.

Best Regards,

Leo

Posted: March 16, 2015 1:41 AM

Hi Thomas,

Sorry for the delay. From the answer I got from our developer team, The event was suppressed by crosslight because all logic operation should be done in ViewModel.

Best Regards,
Leo

Posted: March 12, 2015 6:13 AM

Hi James,

I have tried to replicate your issue by testing a sample which is closed to your description. The following are the step-by-step I used in my test:

  1. Add 3 new row.
  2. Delete the second row from the last row (the second row is the second added new row)
  3. Delete the second row from the last row (the second row is the first added new row)
  4. Delete the last row (the last row is the last added new row)

Unfortunately, I could not replicate your issue. All row was deleted successfully. As a reference, I have attach the webgrid sample. Please have it evaluate on your end by adding it to webgrid sample included in installation folder. As a side note, you could trigger webgrid refresh action by "WebGrid1.ClientAction.Refresh()".

Best Regards,
Leo

Hi Bruce,

Glad to hear that the snippet code helps.

Should you need further assistance or run into any problems regarding our controls, feel free to post it into our forum. We would be happy to assist you again.

Best Regards,
Leo

All times are GMT -5. The time now is 11:03 AM.
Previous Next