Available for: UI for ASP.NET MVC | UI for ASP.NET AJAX | UI for Blazor | UI for WPF | UI for WinForms | UI for Xamarin | UI for WinUI | UI for ASP.NET Core

New to Telerik Document Processing? Download free 30-day trial


This article will help you get familiar with the concept of a row and its features.

What is a Row

Rows in the terms of a spreadsheet document are groups of cells that are on the same horizontal line. Each row is identified by a number. For example, the first row has an index 1, the second one – 2 and the last one – 1048576.

IRowExporter Interface

In RadSpreadStreamProcessing, a row could be exported through the IRowExporter interface. It defines several methods allowing you to add cells to a row or change its appearance.

Using IRowExporter

A concrete instance of IRowExporter could be created through the CreateRowExporter() method of IWorksheetExporter. Example 1 demonstrates how you can add a row to a worksheet.

Example 1: Create IRowExporter

using (IRowExporter row = worksheet.CreateRowExporter()) 

IRowExporter inherits from IDisposable. Make sure the object is disposed when you are done with it. Otherwise, the content won't be written in the exported file. The best way to ensure this is handled properly is to wrap it in a using statement.

In order to customize the way a row appears, you could use one of the following methods:

  • SetHeightInPixels(): Sets the row height in pixels.

  • SetHeightInPoints(): Sets the row height in points.

  • SetOutlineLevel(): Sets the row outline level. The outline level is used when grouping rows. To group several rows, they should have the same OutlineLevel and if you would like to create nested grouping, you can use different levels for the outer and for the nested rows.

  • SetHidden(): Sets a boolean value that indicates whether the row should be hidden or not.

Example 2: Set properties to IRowExporter

using (IRowExporter row = worksheet.CreateRowExporter()) 
* Due to the specifics of the library, RadSpreadStreamProcessing doesn't support auto fitting the height of the rows. You can find information on how you can calculate the height needed for specific content in the Get Cell Content Size topic.

Skip Rows

The rows in a document are exported one by one from top to bottom starting from the one with index 0. In order to export a row with a bigger index, you will need to export all the previous rows or skip them.

In some cases you may need to skip several rows and start filling the data in the next one. The IWorksheetExporter interface declares a method that allows you to implement such scenario. Example 3 shows how to skip 5 rows.

Example 3: Skip rows

using (IRowExporter row = worksheet.CreateRowExporter()) 
    row.SetHidden(true); // The sixth row will be hidden. 

See Also

In this article
Not finding the help you need? Improve this article