Gets the collection of rows of the current RenderTable.
Getting a row with an arbitrary index on this collection
always returns a TableRow object, initializing it if necessary.
Namespace:
C1.C1PreviewAssembly: C1.C1Report.2 (in C1.C1Report.2.dll)
Syntax
C# |
---|
public TableRowCollection Rows { get; } |
Visual Basic |
---|
Public ReadOnly Property Rows As TableRowCollection Get |
Examples
The following example uses the Rows property to define a style for a particular row:
Copy CodeVisual Basic
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load MakeDoc1(C1PrintDocument1) C1PrintDocument1.Generate() End Sub Private Sub MakeDoc1(ByVal doc As C1.C1Preview.C1PrintDocument) Dim rt As New C1.C1Preview.RenderTable() Dim row As Integer For row = 0 To 10 - 1 Step +1 Dim col As Integer For col = 0 To 4 - 1 Step +1 rt.Cells(row, col).Text = String.Format("Text in cell({0}, {1})", row, col) Next Next doc.Body.Children.Add(rt) ' Define a row style. rt.Rows(4).Style.Font = New Font("Arial", 12, FontStyle.Bold Or FontStyle.Italic) End Sub |
Copy CodeC#
private void Form1_Load(object sender, EventArgs e) { MakeDoc1(c1PrintDocument1); c1PrintDocument1.Generate(); } private void MakeDoc1(C1.C1Preview.C1PrintDocument doc) { C1.C1Preview.RenderTable rt = new C1.C1Preview.RenderTable(); for (int row = 0; row < 10; ++row) { for (int col = 0; col < 4; ++col) { rt.Cells[row, col].Text = string.Format("Text in cell({0}, {1})", row, col); } } doc.Body.Children.Add(rt); // Define a row style. rt.Rows[4].Style.Font = new Font("Arial", 12, FontStyle.Bold | FontStyle.Italic); } |
For more information on this example, see the Table3 sample.