GrapeCity.Win.MultiRow Namespace > Template Class > CreateGridTemplate Method : CreateGridTemplate(Int32,Int32,Int32,Int32) Method |
Public Overloads Shared Function CreateGridTemplate( _ ByVal columnCount As Integer, _ ByVal cellWidth As Integer, _ ByVal cellHeight As Integer, _ ByVal columnsMaxWidth As Integer _ ) As Template
Dim columnCount As Integer Dim cellWidth As Integer Dim cellHeight As Integer Dim columnsMaxWidth As Integer Dim value As Template value = Template.CreateGridTemplate(columnCount, cellWidth, cellHeight, columnsMaxWidth)
public static Template CreateGridTemplate( int columnCount, int cellWidth, int cellHeight, int columnsMaxWidth )
Exception | Description |
---|---|
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. |
class CreateGridTemplateDemo:Form { private GcMultiRow gcMultiRow1 = new GcMultiRow(); private FlowLayoutPanel panel = new FlowLayoutPanel(); public CreateGridTemplateDemo() { this.Text = "CreateGridTemplate Demo"; this.Size = new Size(1000, 750); // Initial flow layout panel and add to form. this.panel.Dock = DockStyle.Left; this.panel.Size = new Size(450, 200); this.panel.FlowDirection = FlowDirection.TopDown; this.panel.WrapContents = false; this.panel.Padding = new Padding(5); this.panel.AutoSize = true; this.Controls.Add(panel); this.gcMultiRow1.Dock = DockStyle.Left; this.gcMultiRow1.Width = 550; this.Controls.Add(this.gcMultiRow1); this.Load += new EventHandler(Form1_Load); InitButton(); this.StartPosition = FormStartPosition.CenterScreen; } private void Form1_Load(object sender, EventArgs e) { gcMultiRow1.Template = Template.Default; gcMultiRow1.RowCount = 20; } void setSecond_Click(object sender, EventArgs e) { Template template1 = Template.CreateGridTemplate(5, 100, 25); this.gcMultiRow1.Template = template1; }
Class CreateGridTemplateDemo Inherits Form Private gcMultiRow1 As New GcMultiRow() Private panel As New FlowLayoutPanel() Public Sub New() Me.Text = "CreateGridTemplate Demo" Me.Size = New Size(1000, 750) ' Initial flow layout panel and add to form. Me.panel.Dock = DockStyle.Left Me.panel.Size = New Size(450, 200) Me.panel.FlowDirection = FlowDirection.TopDown Me.panel.WrapContents = False Me.panel.Padding = New Padding(5) Me.panel.AutoSize = True Me.Controls.Add(panel) Me.gcMultiRow1.Dock = DockStyle.Left Me.gcMultiRow1.Width = 550 Me.Controls.Add(Me.gcMultiRow1) InitButton() Me.StartPosition = FormStartPosition.CenterScreen End Sub Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load gcMultiRow1.Template = Template.Default gcMultiRow1.RowCount = 20 End Sub Private Sub setSecond_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setSecond.Click Dim template1 As Template = Template.CreateGridTemplate(5, 100, 25) Me.gcMultiRow1.Template = template1 End Sub
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
Template Class
Template Members
Overload List
CreateGridTemplate(Int32) Method
CreateGridTemplate(Int32,Int32,Int32) Method
CreateGridTemplate(Int32,Int32,Int32,Int32,AutoGenerateGridTemplateStyles) 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