Example #1
0
        private void FetchRows()
        {
            // Fetch rows from provider
            _rows.Clear();
            if (RowNeeded != null)
            {
                for (long i = _firstDisplayedRowIndex; i < _firstDisplayedRowIndex + _pageSize && i < _rowsCount; i++)
                {
                    FastGridRow row = new FastGridRow(this);
                    row.Cells = new FastGridCell[_columns.Count];
                    for (int k = 0; k < _columns.Count; k++)
                    {
                        if (_columns[k].ColumnType == FastGridColumnType.Text)
                        {
                            row.Cells[k] = new FastGridCell(this);
                        }
                        else if (_columns[k].ColumnType == FastGridColumnType.CheckBox)
                        {
                            row.Cells[k] = new FastGridCheckBoxCell(this);
                        }
                        else
                        {
                            throw new InvalidOperationException();
                        }
                    }

                    RowNeededEventArgs ev = new RowNeededEventArgs(i, row);
                    RowNeeded(this, ev);
                    _rows.Add(row);
                } // for
            }
        }
Example #2
0
 public RowNeededEventArgs(long index, FastGridRow row)
 {
     _row   = row;
     _index = index;
 }