public virtual void OnViewRecycled(AbstractViewHolder holder)
 {
     base.OnViewRecycled(holder);
     CellRecyclerViewAdapter.CellRowViewHolder viewHolder = (CellRecyclerViewAdapter.CellRowViewHolder)holder;
     // ScrolledX should be cleared at that time. Because we need to prepare each
     // recyclerView
     // at onViewAttachedToWindow process.
     viewHolder.recyclerView.ClearScrolledX();
 }
        public virtual void OnBindViewHolder(AbstractViewHolder holder, int yPosition)
        {
            CellRecyclerViewAdapter.CellRowViewHolder viewHolder = (CellRecyclerViewAdapter.CellRowViewHolder)holder;
            CellRowRecyclerViewAdapter viewAdapter = (CellRowRecyclerViewAdapter)viewHolder.recyclerView.GetAdapter();
            // Get the list
            IList <ICell> rowList = mItemList[yPosition];

            // Set Row position
            viewAdapter.SetYPosition(yPosition);
            // Set the list to the adapter
            viewAdapter.SetItems(rowList);
        }
        public virtual void OnViewAttachedToWindow(AbstractViewHolder holder)
        {
            base.OnViewAttachedToWindow(holder);
            CellRecyclerViewAdapter.CellRowViewHolder viewHolder = (CellRecyclerViewAdapter.CellRowViewHolder)holder;
            ScrollHandler scrollHandler = mTableView.GetScrollHandler();

            // The below code helps to display a new attached recyclerView on exact scrolled position.
            ((ColumnLayoutManager)viewHolder.recyclerView.GetLayoutManager()).ScrollToPositionWithOffset(
                scrollHandler.GetColumnPosition(), scrollHandler.GetColumnPositionOffset());
            SelectionHandler selectionHandler = mTableView.GetSelectionHandler();

            if (selectionHandler.IsAnyColumnSelected())
            {
                AbstractViewHolder cellViewHolder =
                    (AbstractViewHolder)viewHolder.recyclerView.FindViewHolderForAdapterPosition(
                        selectionHandler.GetSelectedColumnPosition());
                if (cellViewHolder != null)
                {
                    // Control to ignore selection color
                    if (!mTableView.IsIgnoreSelectionColors())
                    {
                        cellViewHolder.SetBackgroundColor(mTableView.GetSelectedColor());
                    }

                    cellViewHolder.SetSelected(AbstractViewHolder.SelectionState.Selected);
                }
            }
            else
            {
                if (selectionHandler.IsRowSelected(holder.AdapterPosition))
                {
                    selectionHandler.ChangeSelectionOfRecyclerView(viewHolder.recyclerView,
                                                                   AbstractViewHolder.SelectionState.Selected, mTableView.GetSelectedColor());
                }
            }
        }