Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
785
Using IGGridViewDataSourceHelperLoadMoreDelegate and IGGridViewDelegate.ResolveSectionHeaderView
posted

Hey - I've attached a sample project to explain this a little better, but essentially what I'm having an issue with is when the grid goes out and does a LoadMore rows, the SectionHeaderView is being redrawn but then when I scroll back up it remains in the middle of the grid.

I was wondering what you think I'm doing wrong.

SimpleGrid.zip
  • 40030
    Verified Answer
    Offline posted

    Hi, 

    That is strange. From what i can tell, it appears to be a timing issue.  As a workaround, if you call UpdateData in a beginInvoke call, it gives the section header enough time to update. I've updated a code snippet below and my changes are in bold. 

    public override void LoadMoreRows (IGGridViewDataSourceHelper dataSource)
                {
                    mClinicNavigatorViewController.mPage++;

                    if (mClinicNavigatorViewController.lstGridItems.Count > 0) {
                        mClinicNavigatorViewController.lstGridItems.InsertRange (mClinicNavigatorViewController.lstGridItems.Count, LoadMorePendingDocuments ());

                        //Rebind the datasource
                        dataSource.Data = mClinicNavigatorViewController.lstGridItems.ToArray ();

                        //Update the display
                        this.BeginInvokeOnMainThread (() => {
                            gridView.UpdateData ();
                        });



                    }
                }

    Let me know if that helps. 

    -SteveZ