This is a migrated thread and some comments may be shown as answers.

Spreadsheet row and column

3 Answers 213 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Mattheu
Top achievements
Rank 1
Mattheu asked on 12 Sep 2013, 04:01 PM
Is there a way to get the rows and columns for cells that has value without having to traverse through the whole worksheet? When I read in Row and Column count, it just gives me what Excel max is for row and column. Thanks.

3 Answers, 1 is accepted

Sort by
0
Anna
Telerik team
answered on 13 Sep 2013, 10:06 AM
Hi Mattheu,

While the Spreadsheet doesn't provide a method that will allow you to get all the cells with values, there is an easy way to vastly narrow down the search for them. The UsedCellRange will give you the cell range of the Worksheet which contains all the used cells. You can see how to get the UsedCellRange in the snippet below.
CellRange usedCellRange = this.radSpreadsheet.ActiveWorksheet.UsedCellRange;

The CellRange exposes properties like FromIndex and ToIndex that will give you the upper left corner and the bottom right corner indices of the CellRange. You will be able to iterate through the CellRange and find the cells with values different from EmptyCellValue.

I hope this answers your question. If you have any comments or you need any further clarifications, please, let us know.

Regards,
Anna
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Mattheu
Top achievements
Rank 1
answered on 07 Nov 2013, 01:59 PM
excellent. Exactly what I was looking needing.
0
Sudha
Top achievements
Rank 1
answered on 12 Sep 2017, 07:51 PM
I want to more rows in the spread sheet 2000 but it is allowing only 200 how to upload 2000 rows in spread sheet
Tags
Spreadsheet
Asked by
Mattheu
Top achievements
Rank 1
Answers by
Anna
Telerik team
Mattheu
Top achievements
Rank 1
Sudha
Top achievements
Rank 1
Share this question
or