internal int GetRenderedCellIndex(int columnIndex)
{
if (columnIndex == 0)
return columnIndex;
if (this.cells != null)
{
for (int i = columnIndex; i > -1; i--)
{
Cell cell = this.cells[i];
if (cell.ColSpan > 1 && (i + cell.ColSpan >= columnIndex))
{
// Then this cell (i) covers the cell at columnIndex for this row
return i;
}
}
}
// If no cells have colspan > 0 then the answer is the column we were given:
return columnIndex;
}