private bool IsCellVisible(int row, int column, bool includeDisabledCells)
{
bool ok = (this.IsValidCell(row, column) &&
this.IsValidColumn(column) &&
(this.TableModel[row, column].Enabled || includeDisabledCells) &&
this.ColumnModel.Columns[column].Enabled &&
this.ColumnModel.Columns[column].Visible);
if (ok)
{
// If this cell belongs to a row that is in fact a sub row, and this subrow is hidden, then return false.
Cell cell = this.TableModel[row, column];
if (cell.Row.Parent != null)
{
ok = cell.Row.Parent.ExpandSubRows;
}
}
return ok;
}