Gets the collection of UserCellGroup objects defined on the current table.

Namespace:  C1.C1Preview
Assembly:  C1.C1Report.2 (in C1.C1Report.2.dll)

Syntax

C#
public UserCellGroupCollection UserCellGroups { get; }
Visual Basic
Public ReadOnly Property UserCellGroups As UserCellGroupCollection
	Get

Examples

The following example uses the UserCellGroups property to define a cell group with a background color:

Copy CodeVisual Basic
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    MakeDoc1(C1PrintDocument1)
    C1PrintDocument1.Generate()
End Sub
Private Sub MakeDoc1(ByVal doc As C1.C1Preview.C1PrintDocument)
    ' Create and fill the table.
    Dim rt As C1.C1Preview.RenderTable = New C1.C1Preview.RenderTable()
    Dim row As Integer
    Dim col As Integer
    For row = 0 To 12 - 1 Step +1
        For col = 0 To 6 - 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 cell group with a background color.
    rt.UserCellGroups.Add(New C1.C1Preview.UserCellGroup(New Rectangle(1, 4, 2, 3)))
    rt.UserCellGroups(0).Style.BackColor = Color.PaleGreen
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 < 12; ++row)
    {
        for (int col = 0; col < 6; ++col)
        {
            rt.Cells[row, col].Text = string.Format("Text in cell({0}, {1})", row, col);
        }
    }
    // Define a cell group with a background color.
    rt.UserCellGroups.Add(new C1.C1Preview.UserCellGroup(new Rectangle(1, 4, 2, 3)));
    rt.UserCellGroups[0].Style.BackColor = Color.PaleGreen;
    doc.Body.Children.Add(rt);
}

See Also