Framework / Presentation Layer / Smart Shapes / Shape Sheet / User Defined Cells Section

In This Topic
    User Defined Cells Section
    In This Topic

    The user defined cells section (or simply users section) is used to store named cells, which are defined by the shape author. Its purpose is similar to the purpose of the scratch section, but the difference is that the scratch section stores rows, while the users section stores named cells. The users section is an optional section, which is represented by an instance of the NUserDefinedCellsSection class. This section is created and accessed by the UserDefinedCellsSection property:

    C#
    Copy Code
    // create the users section and add a user cell
    sheet.UserDefinedCellsSection = new NUserDefinedCellsSection();
    sheet.UserDefinedCellsSection.AddUserCell("ControlX1", "MAX(0,MIN(Width/2,Controls.X1))");
    
    Visual Basic
    Copy Code
    ' create the users section and add a user cell
    sheet.UserDefinedCellsSection = new NUserDefinedCellsSection()
    sheet.UserDefinedCellsSection.AddUserCell("ControlX1", "MAX(0,MIN(Width/2,Controls.X1))")
    
     User Cells

    User cells are added to the Cells dictionary of the users section (see Formula Sections for more information). This means that in the shape sheet these cells can be referenced by their name.

    By design all named cells in the shape sheet have unique names, which allows you to write more compact formulas (e.g. you do not have to explicitly specify the section name - for example: Width*0.5 is an abbreviation for Transform.Width*0.5).

    To avoid unpleasant errors caused by cell name duplication, it is recommended to reference user cells with their full name. For example: User.ControlX2 instead of ControlX2 only.

    See Also