GetCellsInfo doesn''t work for Column or Row ranges

Calling that method with a range that's column or row based causes an exception. See my attached project. You can click on cells and multi-select but if you click on a row or column header you get an arithmetic exception.

Is there a function I can use to convert Column or Row ranges to Cell based ranges?

Thanks

CellInfoDefect.zip

2 Replies

BR Brian Richards May 22, 2007 08:46 PM UTC

I'm using version 5.1

>Calling that method with a range that's column or row based causes an exception. See my attached project. You can click on cells and multi-select but if you click on a row or column header you get an arithmetic exception.

Is there a function I can use to convert Column or Row ranges to Cell based ranges?

Thanks

CellInfoDefect.zip


HA haneefm Syncfusion Team May 22, 2007 11:22 PM UTC

Hi Brain,

You can try this code in a SelectionChanged event of the grid and let me know if this helps.

GridRangeInfo range = gridControl1.Selections.Ranges.ActiveRange;
if (range.IsRows)
range = GridRangeInfo.Cells(range.Top, 0, range.Bottom, gridControl1.ColCount);
else if (range.IsCols)
range = GridRangeInfo.Cells(0, range.Left, gridControl1.RowCount,range.Right);
GridStyleInfo[] info = gridControl1.GetCellsInfo(range);

Best regards,
Haneef

Loader.
Up arrow icon