private Row GetRowFromDataSource(int index)
{
object row = dataManager.List[index];
PropertyDescriptorCollection propColl = dataManager.GetItemProperties();
Cell[] cells = new Cell[this.ColumnModel.Columns.Count];
// Fill value for each column
int i = 0;
foreach (Column column in this.ColumnModel.Columns)
{
PropertyDescriptor prop = propColl.Find(column.Text, false);
if (prop == null)
throw new ApplicationException(string.Format("Cannot find property '{0}' in datasource.", column.Text));
object val = prop.GetValue(row);
Cell cell = this.DataSourceColumnBinder.GetCell(column, val);
cells.SetValue(cell, i);
i++;
}
return new Row(cells);
}