GrapeCity MultiRow Windows Forms Documentation
CreateGridTemplate(Int32,Int32,Int32,Int32,AutoGenerateGridTemplateStyles) Method
Example 


A System.Int32 that indicates the column count.
A System.Int32 that indicates the cell width in the Row section.
A System.Int32 that indicates the cell height in the Row section.
A System.Int32 that indicates the maximum column width.
One of the AutoGenerateGridTemplateStyles values that indicate which elements are generated in the template.
Creates a standard Template matrix with the specified column count, cell size, maximum column width, and template style.
Syntax
Public Overloads Shared Function CreateGridTemplate( _
   ByVal columnCount As Integer, _
   ByVal cellWidth As Integer, _
   ByVal cellHeight As Integer, _
   ByVal columnsMaxWidth As Integer, _
   ByVal autoGenerateGridTemplateStyles As AutoGenerateGridTemplateStyles _
) As Template
Dim columnCount As Integer
Dim cellWidth As Integer
Dim cellHeight As Integer
Dim columnsMaxWidth As Integer
Dim autoGenerateGridTemplateStyles As AutoGenerateGridTemplateStyles
Dim value As Template
 
value = Template.CreateGridTemplate(columnCount, cellWidth, cellHeight, columnsMaxWidth, autoGenerateGridTemplateStyles)

Parameters

columnCount
A System.Int32 that indicates the column count.
cellWidth
A System.Int32 that indicates the cell width in the Row section.
cellHeight
A System.Int32 that indicates the cell height in the Row section.
columnsMaxWidth
A System.Int32 that indicates the maximum column width.
autoGenerateGridTemplateStyles
One of the AutoGenerateGridTemplateStyles values that indicate which elements are generated in the template.

Return Value

A Template that represents a standard Template matrix.
Exceptions
ExceptionDescription
System.ArgumentOutOfRangeException

The columnCount is less than or equal to 0.

-or-

The cellWidth is less than or equal to 0.

-or-

The cellHeight is less than or equal to 0.

-or-

The columnsMaxWidth is less than or equal to 0.

System.ComponentModel.InvalidEnumArgumentExceptionThe autoGenerateGridTemplateStyles value is not a valid AutoGenerateGridTemplateStyles value.
Remarks
This method is based on the CreateGridTemplate(Int32,Int32,Int32,Int32) method. You can determine which elements are generated by this method with autoGenerateGridTemplateStyles.
Example
The following code example shows how to use this method to create a grid template. This code example is part of a larger example provided for the CreateGridTemplate(int) class.
void setThird_Click(object sender, EventArgs e)
     {
         Template template1 = Template.CreateGridTemplate(8, 100, 25, 400, AutoGenerateGridTemplateStyles.RowHeaderAutoNumber | AutoGenerateGridTemplateStyles.ColumnHeader, 50);
         this.gcMultiRow1.Template = template1;
     }
Private Sub setThird_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setThird.Click
        Dim template1 As Template = Template.CreateGridTemplate(8, 100, 25, 400, AutoGenerateGridTemplateStyles.RowHeaderAutoNumber Or AutoGenerateGridTemplateStyles.ColumnHeader, 50)
        Me.gcMultiRow1.Template = template1
    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
Overload List
CreateGridTemplate(Int32) Method
CreateGridTemplate(Int32,Int32,Int32) Method
CreateGridTemplate(Int32,Int32,Int32,Int32) Method
CreateGridTemplate(Int32,Int32,Int32,Int32,AutoGenerateGridTemplateStyles,Int32) Method
CreateGridTemplate(IEnumerable<Cell>) Method
CreateGridTemplate(IEnumerable<Cell>,Int32) Method
CreateGridTemplate(IEnumerable<Cell>,Int32,AutoGenerateGridTemplateStyles) Method
CreateGridTemplate(IEnumerable<Cell>,Int32,AutoGenerateGridTemplateStyles,Int32) Method

 

 


Copyright © GrapeCity, inc. All rights reserved.