GrapeCity MultiRow Windows Forms Documentation
Width Property (Template)
Example 


Gets or sets the width of the Template in pixels.
Syntax
<LocalizableAttribute(True)>
<SRCategoryAttribute("Layout")>
<SRDescriptionAttribute("Indicates the width of the Sections in the Template.")>
Public Property Width As Integer
Dim instance As Template
Dim value As Integer
 
instance.Width = value
 
value = instance.Width
[Localizable(true)]
[SRCategory("Layout")]
[SRDescription("Indicates the width of the Sections in the Template.")]
public int Width {get; set;}

Property Value

The width of the Template. The default is 620.
Remarks

When the LayoutMode property's value is LayoutMode.TopToBottom, the value of this property is a single section's width. When the LayoutMode property's value is LayoutMode.LeftToRight, the value of this property is the total of all section's width.

Changing this property's value when the LayoutMode property is LayoutMode.LeftToRight has no effect.

Example
The following code example shows how to set the Template.Width. This code example is part of a larger example provided for the HeaderCell class.
private void Form1_Load(object sender, EventArgs e)
        {
            Template template1 = new Template();

            ColumnHeaderSection columnHeader1 = CreateColumnHeader();
            template1.ColumnHeaders.Add(columnHeader1);

            template1.Row.Cells.AddRange(CreateCellsInRow());
            template1.Row.Height = 21;

            ColumnFooterSection columnFooter1 = CreateColumnFooter();
            template1.ColumnFooters.Add(columnFooter1);

            template1.Width = 196;

            gcMultiRow1.Template = template1;
            gcMultiRow1.RowCount = 10;
            gcMultiRow1.ViewMode = ViewMode.Row;
        }
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        Dim template1 As New Template()

        Dim columnHeader1 As ColumnHeaderSection = CreateColumnHeader()
        template1.ColumnHeaders.Add(columnHeader1)

        template1.Row.Cells.AddRange(CreateCellsInRow())
        template1.Row.Height = 21

        Dim columnFooter1 As ColumnFooterSection = CreateColumnFooter()
        template1.ColumnFooters.Add(columnFooter1)

        template1.Width = 196

        gcMultiRow1.Template = template1
        gcMultiRow1.RowCount = 10
        gcMultiRow1.ViewMode = ViewMode.Row
    End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Template Class
Template Members

 

 


Copyright © GrapeCity, inc. All rights reserved.