Empty cells & rows

3 posts, 1 answers
  1. Mark
    Mark avatar
    6 posts
    Member since:
    Nov 2010

    Posted 13 Oct 2015 Link to this post

    I've used the example show in de docs to import a csv file into a worksheet:

    http://docs.telerik.com/devtools/aspnet-ajax/controls/spreadprocessing/formats-and-conversion/csv/csvformatprovider

    After importing the file, the worksheet is filled with the proper data. However, the Columns.Count and Rows.Count properties are set on the maximum they can be, not the number of imported rows and columns. 

    What is the fast way to find out which rows and columns are empty? I want to stop processing the document as soon as I've reached the first empty row.

     

  2. Answer
    Anna
    Admin
    Anna avatar
    99 posts

    Posted 14 Oct 2015 Link to this post

    Hello Mark,

    These properties indeed return the total rows/columns count of the worksheet, regardless of whether they are empty or not. In your case I would suggest using the UsedCellRange property of the worksheet. The ToIndex property of the used cell range should tell you where the last non-empty cell is, that is, the row and column it belongs to.

    I hope this suggestion will be helpful.

    Regards,
    Anna
    Telerik
  3. Mark
    Mark avatar
    6 posts
    Member since:
    Nov 2010

    Posted 14 Oct 2015 in reply to Anna Link to this post

    Thank you, that was the property I was looking for
Back to Top