property Grid.ToTemplate ([DefaultTemplate as Variant]) as String
Generates the control's template.

TypeDescription
DefaultTemplate as Variant A String expression that indicates the default format used to define the control's template at runtime, or a string expression that indicates the path to the file being used to define the default template ( like c:\temp\teml.bin ). If it is missing ( by default ), the control's uses the default implementation ( listed bellow ) to define the control's template, at runtime. Each line in the DefaultTemplate parameter, defines a property or an instruction to generate the template.
String A String expression that indicates the control's template.
Use the ToTemplate property to save the control's content to a template string. The ToTemplate property saves the control's properties based on the default template. Use the ToTemplate property to copy the control's content to another instance. The ToTemplate property can save pictures, icons, binary arrays, objects, collections, and so on based on the DefaultTemplate parameter.

The DefaultTemplate parameter indicates the format of the template being used to generate the control's template at runtime. If the DefaultTemplate parameter is missing, the control's uses its default template listed bellow. The DefaultTemplate parameter defines the list of properties and instructions that generates the control's template. Remove the properties and objects, in the default template, that you don't need in the generated template script. Use the Template property to apply the template to the control. Use the Template property to execute code by passing instructions as a string ( template string ). The Template script is composed by lines of instructions. Instructions are separated by "\n\r" ( newline) characters. The Template format contains a list of instructions that loads data and change properties for the objects in the control. Use the AllowCopyTemplate property to copy the control's content to the clipboard, in template format, using the the Shift + Ctrl + Alt + Insert sequence. 

The time to generate the control's template depends on:

For instance, let's say that we have the following DefaultTemplate parameter:

Appearance = 2
AutoEdit = -1

In this case the ToTemplate property generates code only for the properties Appearance and AutoEdit, if they were changed to a different value. 

If the DefaultTemplate parameters looks like:

Appearance
AutoEdit = -1

The ToTemplate property always generates code for the Appearance property, and it generates code for the AutoEdit property only if this is changed to a value different than -1.

If the DefaultTemplate parameter is missing, the control uses its default template to generate the template format. The default template format looks like follow, and it may differ from a version to another.

[0 = BeginUpdate]
VisualAppearance
	[0 = Add(%ID,%CONTENT)]
[3 = HTMLPicture("%KEY")=LoadPicture("%PICTURE")]
[1 = Images(%VALUE)]
Appearance = 2
ASCIILower = "abcdefghijklmnopqrstuvwxyzüéâäàåçêëèïîìôöòûùáíóúñ"
ASCIIUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZÜÉÂÄÀÅÇÊËÈÏÎÌÔÖÒÛÙÁÍÓÚÑ"
AutoEdit = -1
AutoSearch = -1
BackColor = 2147483653
BackColorAlternate = 0
BackColorHeader = 2147483663
BackColorLevelHeader = 2147483663
BackColorLock = 2147483653
BackColorSortBar = 2147483664
BackColorSortBarCaption = 2147483663
Background(7) = 0
Background(6) = 0
Background(3) = 0
Background(2) = 0
Background(32) = 0
Background(8) = 0
Background(12) = 0
Background(11) = 0
Background(14) = 0
Background(13) = 0
Background(10) = 0
Background(9) = 0
Background(34) = 0
Background(33) = 0
Background(37) = 0
Background(36) = 0
Background(35) = 0
Background(5) = 0
Background(4) = 0
Background(1) = 0
Background(0) = 0
Background(404) = 0
Background(406) = 0
Background(407) = 0
Background(405) = 0
Background(384) = 0
Background(386) = 0
Background(387) = 0
Background(385) = 0
Background(396) = 0
Background(398) = 0
Background(399) = 0
Background(397) = 0
Background(392) = 0
Background(394) = 0
Background(395) = 0
Background(393) = 0
Background(388) = 0
Background(390) = 0
Background(391) = 0
Background(389) = 0
Background(400) = 0
Background(402) = 0
Background(403) = 0
Background(401) = 0
Background(324) = 0
Background(326) = 0
Background(327) = 0
Background(325) = 0
Background(511) = 0
Background(20) = 0
Background(17) = 0
Background(21) = 0
Background(15) = 0
Background(16) = 0
Background(25) = 0
Background(24) = 0
Background(23) = 0
Background(22) = 0
Background(276) = 0
Background(278) = 0
Background(279) = 0
Background(277) = 0
Background(264) = 0
Background(266) = 0
Background(267) = 0
Background(265) = 0
Background(268) = 0
Background(270) = 0
Background(271) = 0
Background(269) = 0
Background(260) = 0
Background(262) = 0
Background(263) = 0
Background(261) = 0
Background(256) = 0
Background(258) = 0
Background(259) = 0
Background(257) = 0
Background(272) = 0
Background(274) = 0
Background(275) = 0
Background(273) = 0
CauseValidateValue = 0
CheckImage(1) = 0
CheckImage(2) = 0
CheckImage(0) = 0
ColumnAutoResize = -1
ColumnsAllowSizing = 0
ContinueColumnScroll = -1
CountLockedColumns = 0
DefaultEditorOption(37) = 0
DefaultEditorOption(39) = 0
DefaultEditorOption(103) = 24
DefaultEditorOption(104) = "7,8,9,/,C\r\n4,5,6,*,1/x\r\n1,2,3,-,sqrt\r\n0,+/-,.,+,="
DefaultEditorOption(102) = 24
DefaultEditorOption(101) = "Cannot divide by zero."
DefaultEditorOption(100) = -1
DefaultEditorOption(106) = ""
DefaultEditorOption(105) = ""
DefaultEditorOption(15) = 0
DefaultEditorOption(16) = 1
DefaultEditorOption(17) = 2
DefaultEditorOption(4) = 0
DefaultEditorOption(5) = -1
DefaultEditorOption(6) = -1
DefaultEditorOption(14) = -1
DefaultEditorOption(32) = 0
DefaultEditorOption(34) = 0
DefaultEditorOption(30) = "January February March April May June July August September October November December"
DefaultEditorOption(35) = -1
DefaultEditorOption(33) = -1
DefaultEditorOption(29) = "Today"
DefaultEditorOption(31) = "S M T W T F S"
DefaultEditorOption(47) = 0
DefaultEditorOption(23) = -1
DefaultEditorOption(28) = -1
DefaultEditorOption(46) = 46
DefaultEditorOption(36) = 0
DefaultEditorOption(50) = -2147483633
DefaultEditorOption(51) = 0
DefaultEditorOption(18) = 0
DefaultEditorOption(19) = 42
DefaultEditorOption(10) = 0
DefaultEditorOption(49) = -1
DefaultEditorOption(48) = 0
DefaultEditorOption(25) = -1
DefaultEditorOption(38) = 0
DefaultEditorOption(24) = -1
DefaultEditorOption(45) = 0
DefaultEditorOption(20) = -1
DefaultEditorOption(3) = -1
DefaultEditorOption(9) = -1
DefaultEditorOption(8) = 116
DefaultEditorOption(7) = 128
DefaultEditorOption(1) = 0
DefaultEditorOption(2) = 0
DefaultEditorOption(27) = -1
DefaultEditorOption(26) = -1
DefaultEditorOption(12) = 0
DefaultEditorOption(11) = -2147483635
DefaultEditorOption(13) = -1
DefaultEditorOption(21) = -1
DefaultEditorOption(52) = -1
DefaultEditorOption(44) = 100
DefaultEditorOption(43) = 0
DefaultEditorOption(42) = 1
DefaultEditorOption(41) = 64
DefaultEditorOption(40) = 1
DefaultEditorOption(22) = -1
DefaultItemHeight = 18
Description(0) = "(All)"
Description(11) = "and"
Description(1) = "(Blanks)"
Description(19) = "(Checked)"
Description(12) = "Date:"
Description(17) = "January February March April May June July August September October November December"
Description(15) = "Date"
Description(13) = "to"
Description(16) = "Today"
Description(14) = "You can filter the items into a given interval of dates. For instance, you can filter all items dated before a specified date ( to 2/13/2004 ), or all items dated after a date ( Feb 13 2004 to ) or all items that are in a given interval ( 2/13/2004 to 2/13/2005 )."
Description(18) = "S M T W T F S"
Description(3) = "Filter For:"
Description(8) = "A pattern filter may contain the wild card characters '?' for any single character, '*' for zero or more occurrences of any character, '#' for any digit character, '|' determines the options in the pattern. For instance: '1*|2*' specifies all items that start with '1' or '2'. If the filter is of numeric type you can filter numbers giving numeric rules. For instance, ">10 <100" filter indicates all numbers greater than 10 and less than 100."
Description(4) = "Filter"
Description(9) = "IsBlank"
Description(21) = "IsChecked"
Description(10) = "not IsBlank"
Description(22) = "not IsChecked"
Description(2) = "(NonBlanks)"
Description(5) = "Pattern/Numeric Filter"
Description(7) = "You can select multiple filter items as many as you like by keeping the CTRL key pressed. Start typing characters if you like to enter a filter as a pattern that may include wild card characters like *,? or #. Press ENTER key to filter the items using the typed pattern. If the filter is of numeric type you can filter numbers giving numeric rules. For instance, ">10 <100" filter indicates all numbers greater than 10 and less than 100."
Description(6) = "You can select multiple filter items as many as you like by keeping the CTRL key pressed. "
Description(20) = "(Unchecked)"
Description(24) = "not"
Description(23) = "or"
DetectAddNew = 0
DetectDelete = 0
DrawGridLines = 0
Enabled = -1
EnsureOnSort = -1
ExpandOnDblClick = -1
ExpandOnKeys = -1
ExpandOnSearch = 0
FilterBarBackColor = 2147483663
FilterBarCaption = ""
FilterBarDropDownHeight = 0.5
FilterBarFont
	Bold = -1
	Charset = 0
	Italic = 0
	Name = "Arial"
	Size = 8.25
	Strikethrough = 0
	Underline = 0
	Weight = 700
FilterBarForeColor = 2147483656
FilterBarHeight = -1
FilterInclude = 0
FilterCriteria = ""
FocusColumnIndex = 0
Font
	Bold = 0
	Charset = 0
	Italic = 0
	Name = "Arial"
	Size = 8.25
	Strikethrough = 0
	Underline = 0
	Weight = 400
ForeColor = 2147483656
ForeColorHeader = 2147483656
ForeColorLock = 2147483656
ForeColorSortBar = 2147483664
FullRowSelect = -1
GridLineColor = 8949832
HasButtons = -1
HasButtonsCustom(0) = 0
HasButtonsCustom(-1) = 0
HasLines = -1
HeaderAppearance = 3
HeaderHeight = 18
HeaderVisible = -1
HideSelection = 0
HyperLinkColor = 16737585
Indent = 22
ItemsAllowSizing = 0
LinesAtRoot = 0
MarkSearchColumn = -1
MarkTooltipCells = 0
MarkTooltipCellsImage = 0
OLEDropMode = 0
PictureDisplay = 48
[255 = Picture = LoadPicture("%VALUE")]
PictureDisplayLevelHeader = 48
[256 = PictureLevelHeader = LoadPicture("%VALUE")]
RadioImage(0) = 0
RadioImage(-1) = 0
RClickSelect = 0
ReadOnly = 0
ScrollBars = 3
ScrollBySingleLine = 0
ScrollFont(0)
	Bold = 0
	Charset = 0
	Italic = 0
	Name = "Arial"
	Size = 6.75
	Strikethrough = 0
	Underline = 0
	Weight = 400
ScrollFont(1)
	Bold = 0
	Charset = 0
	Italic = 0
	Name = "Arial"
	Size = 6.75
	Strikethrough = 0
	Underline = 0
	Weight = 400
ScrollButtonWidth = -1
ScrollButtonHeight = -1
ScrollWidth = -1
ScrollHeight = -1
ScrollThumbSize(0) = -1
ScrollThumbSize(1) = -1
ScrollToolTip(0) = ""
ScrollToolTip(1) = ""
ScrollOrderParts(0) = ""
ScrollOrderParts(1) = ""
[4 = ScrollPartVisible(%BAR,%PART) = True]
[5 = ScrollPartEnable(%BAR,%PART) = True]
[6 = ScrollPartCaption(%BAR,%PART) = %VALUE]
SearchColumnIndex = 0
SelBackColor = 2147483661
SelBackMode = 0
SelectByDrag = -1
SelectColumnIndex = 0
SelectColumnInner = 0
SelForeColor = 2147483662
ShowFocusRect = -1
ShowLockedItems = -1
SingleSel = -1
SingleSort = -1
SortBarCaption = "Drag a column header here to sort by that column."
SortBarColumnWidth = -96
SortBarHeight = 18
SortBarVisible = 0
SortOnClick = -1
TooltipCellsColor = 16737585
ToolTipDelay = 500
ToolTipPopDelay = 5000
ToolTipWidth = 196
TreeColumnIndex = 0
UseTabKey = -1
ViewMode = 0
ViewModeOption(0,0) = 0
ViewModeOption(0,1) = 0
ViewModeOption(1,0) = 0
ViewModeOption(1,1) = 0
ViewModeOption(1,2) = 128
ViewModeOption(1,3) = 144
ViewModeOption(1,4) = "1/2/3/4/5/6/7"
ViewModeOption(1,5) = "0"
ViewModeOption(1,6) = -1
ViewModeOption(1,7) = 0
ViewModeOption(1,8) = 0
ViewModeOption(1,9) = 5
ViewModeOption(1,10) = 5
ViewModeOption(1,11) = -1
ViewModeOption(1,12) = 0
ConditionalFormats
	_NewEnum = Add("%Expression","%Key")
		ApplyTo = -1
		BackColor = 0
		Bold = 0
		Enabled = -1
		ForeColor = 0
		Italic = 0
		StrikeOut = 0
		Underline = 0
		Font
			Bold = 0
			Charset = 0
			Italic = 0
			Name = "Arial"
			Size = 8.25
			Strikethrough = 0
			Underline = 0
			Weight = 400
Columns
	_NewEnum = "%Caption"
		Alignment = 0
		AllowDragging = -1
		AllowSizing = -1
		AllowSort = -1
		AutoSearch = 0
		ComputedField = ""
		Data
		Def(4)
		Def(3) = 0
		Def(5)
		Def(32) = ""
		Def(2) = 0
		Def(0) = 0
		Def(1) = 0
		Def(16) = -1
		Def(17) = 0
		DefaultSortOrder = 0
		DisplayFilterButton = 0
		DisplayFilterDate = 0
		DisplayFilterPattern = -1
		DisplaySortIcon = -1
		Editor
			Appearance = 0
			ButtonWidth = 13
			DropDownAlignment = 0
			DropDownAutoWidth = -1
			DropDownMinWidth = 164
			DropDownRows = 7
			DropDownVisible = -1
			EditType = 0
			Locked = 0
			Mask = ""
			MaskChar = 95
			Numeric = 0
			Option(37) = 0
			Option(39) = 0
			Option(103) = 24
			Option(104) = "7,8,9,/,C\r\n4,5,6,*,1/x\r\n1,2,3,-,sqrt\r\n0,+/-,.,+,="
			Option(102) = 24
			Option(101) = "Cannot divide by zero."
			Option(100) = -1
			Option(106) = ""
			Option(105) = ""
			Option(15) = 0
			Option(16) = 1
			Option(17) = 2
			Option(4) = 0
			Option(5) = -1
			Option(6) = -1
			Option(14) = -1
			Option(32) = 0
			Option(34) = 0
			Option(30) = "January February March April May June July August September October November December"
			Option(35) = -1
			Option(33) = -1
			Option(29) = "Today"
			Option(31) = "S M T W T F S"
			Option(47) = 0
			Option(23) = -1
			Option(28) = -1
			Option(46) = 46
			Option(36) = 0
			Option(50) = -2147483633
			Option(51) = 0
			Option(18) = 0
			Option(19) = 42
			Option(10) = 0
			Option(49) = -1
			Option(48) = 0
			Option(25) = -1
			Option(38) = 0
			Option(24) = -1
			Option(45) = 0
			Option(20) = -1
			Option(3) = -1
			Option(9) = -1
			Option(8) = 116
			Option(7) = 128
			Option(1) = 0
			Option(2) = 0
			Option(27) = -1
			Option(26) = -1
			Option(12) = 0
			Option(11) = -2147483635
			Option(13) = -1
			Option(21) = -1
			Option(52) = -1
			Option(44) = 100
			Option(43) = 0
			Option(42) = 1
			Option(41) = 64
			Option(40) = 1
			Option(22) = -1
			PartialCheck = 0
			PopupAppearance = 6
			[0 = AddButton(%BUTTON)]
			[1 = AddItem(%ITEM)]
				[4 = ItemTooltip(%VALUE) = %TOOLTIP]
			[2 = InsertItem(%ITEM)]
				[4 = ItemTooltip(%VALUE) = %TOOLTIP]
			[3 = ExpandAll]
			[5 = UserEditor(%CONTROL,%LICENSE)]
		Enabled = -1
		FilterType = 0
		Filter = ""
		FilterList = 0
		FilterBarDropDownWidth = 1
		FireFormatColumn = 0
		FormatLevel = ""
		HeaderAlignment = 0
		HeaderBold = 0
		HeaderImage = 0
		HeaderImageAlignment = 0
		HeaderItalic = 0
		HeaderStrikeOut = 0
		HeaderUnderline = 0
		HeaderVertical = 0
		HTMLCaption = ""
		Key = ""
		LevelKey
		MaxWidthAutoResize = -1
		MinWidthAutoResize = 0
		PartialCheck = 0
		Position
		Selected = 0
		SortOrder = 0
		SortPosition = -1
		SortType = 0
		ToolTip = "..."
		Visible = -1
		Width = 64
		WidthAutoResize = 0
Items
	PathSeparator = "\"
	LockedItemCount(0) = 0
	LockedItemCount(2) = 0
	[1 = %H = LockedItem(%A,%I)]
		[10 = CellValue(%H,%C) = %VALUE]
		[11 = CellImage(%H,%C) = %VALUE]
		[12 = CellSingleLine(%H,%C) = %VALUE]
		[13 = CellValueFormat(%H,%C) = %VALUE]
		[14 = CellFormatLevel(%H,%C) = %VALUE]
		[15 = CellHasCheckBox(%H,%C) = %VALUE]
		[16 = CellHasRadioButton(%H,%C) = %VALUE]
		[17 = CellState(%H,%C) = %VALUE]
		[18 = CellToolTip(%H,%C) = %VALUE]
		[19 = CellHasButton(%H,%C) = %VALUE]
		[20 = CellButtonAutoWidth(%H,%C) = %VALUE]
		[21 = CellEnabled(%H,%C) = %VALUE]
		[22 = CellEditorVisible(%H,%C) = %VALUE]
		[23 = CellHAlignment(%H,%C) = %VALUE]
		[24 = CellVAlignment(%H,%C) = %VALUE]
		[25 = CellMerge(%H,%C) = %VALUE]
		[26 = CellBold(%H,%C) = %VALUE]
		[27 = CellItalic(%H,%C) = %VALUE]
		[28 = CellUnderline(%H,%C) = %VALUE]
		[29 = CellStrikeOut(%H,%C) = %VALUE]
		[30 = CellForeColor(%H,%C) = %VALUE]
		[31 = CellBackColor(%H,%C) = %VALUE]
		[32 = CellPicture(%H,%C) = %VALUE]
		[33 = CellPictureWidth(%H,%C) = %VALUE]
		[34 = CellPictureHeight(%H,%C) = %VALUE]
		[35 = CellData(%H,%C) = %VALUE]
		[110 = CellEditor(%H,%C)]
			Appearance = 0
			ButtonWidth = 13
			DropDownAlignment = 0
			DropDownAutoWidth = -1
			DropDownMinWidth = 164
			DropDownRows = 7
			DropDownVisible = -1
			EditType = 0
			Locked = 0
			Mask = ""
			MaskChar = 95
			Numeric = 0
			Option(37) = 0
			Option(39) = 0
			Option(103) = 24
			Option(104) = "7,8,9,/,C\r\n4,5,6,*,1/x\r\n1,2,3,-,sqrt\r\n0,+/-,.,+,="
			Option(102) = 24
			Option(101) = "Cannot divide by zero."
			Option(100) = -1
			Option(106) = ""
			Option(105) = ""
			Option(15) = 0
			Option(16) = 1
			Option(17) = 2
			Option(4) = 0
			Option(5) = -1
			Option(6) = -1
			Option(14) = -1
			Option(32) = 0
			Option(34) = 0
			Option(30) = "January February March April May June July August September October November December"
			Option(35) = -1
			Option(33) = -1
			Option(29) = "Today"
			Option(31) = "S M T W T F S"
			Option(47) = 0
			Option(23) = -1
			Option(28) = -1
			Option(46) = 46
			Option(36) = 0
			Option(50) = -2147483633
			Option(51) = 0
			Option(18) = 0
			Option(19) = 42
			Option(10) = 0
			Option(49) = -1
			Option(48) = 0
			Option(25) = -1
			Option(38) = 0
			Option(24) = -1
			Option(45) = 0
			Option(20) = -1
			Option(3) = -1
			Option(9) = -1
			Option(8) = 116
			Option(7) = 128
			Option(1) = 0
			Option(2) = 0
			Option(27) = -1
			Option(26) = -1
			Option(12) = 0
			Option(11) = -2147483635
			Option(13) = -1
			Option(21) = -1
			Option(52) = -1
			Option(44) = 100
			Option(43) = 0
			Option(42) = 1
			Option(41) = 64
			Option(40) = 1
			Option(22) = -1
			PartialCheck = 0
			PopupAppearance = 6
			[0 = AddButton(%BUTTON)]
			[1 = AddItem(%ITEM)]
				[4 = ItemTooltip(%VALUE) = %TOOLTIP]
			[2 = InsertItem(%ITEM)]
				[4 = ItemTooltip(%VALUE) = %TOOLTIP]
			[3 = ExpandAll]
			[5 = UserEditor(%CONTROL,%LICENSE)]
		[1000 = ExpandItem(%H) = %VALUE]
		[1001 = SelectItem(%H) = %VALUE]
		[1002 = ItemHeight(%H) = %VALUE]
		[1003 = ItemDivider(%H) = %VALUE]
		[1004 = ItemDividerLine(%H) = %VALUE]
		[1005 = ItemDividerLineAlignment(%H) = %VALUE]
		[1006 = ItemHasChildren(%H) = %VALUE]
		[1007 = ItemBold(%H) = %VALUE]
		[1008 = ItemItalic(%H) = %VALUE]
		[1009 = ItemUnderline(%H) = %VALUE]
		[1010 = ItemStrikeOut(%H) = %VALUE]
		[1011 = ItemForeColor(%H) = %VALUE]
		[1012 = ItemBackColor(%H) = %VALUE]
		[1014 = ItemData(%H) = %VALUE]
	[0 = %H = %ADD(%VALUE)]
		[10 = CellValue(%H,%C) = %VALUE]
		[11 = CellImage(%H,%C) = %VALUE]
		[12 = CellSingleLine(%H,%C) = %VALUE]
		[13 = CellValueFormat(%H,%C) = %VALUE]
		[14 = CellFormatLevel(%H,%C) = %VALUE]
		[15 = CellHasCheckBox(%H,%C) = %VALUE]
		[16 = CellHasRadioButton(%H,%C) = %VALUE]
		[17 = CellState(%H,%C) = %VALUE]
		[18 = CellToolTip(%H,%C) = %VALUE]
		[19 = CellHasButton(%H,%C) = %VALUE]
		[20 = CellButtonAutoWidth(%H,%C) = %VALUE]
		[21 = CellEnabled(%H,%C) = %VALUE]
		[22 = CellEditorVisible(%H,%C) = %VALUE]
		[23 = CellHAlignment(%H,%C) = %VALUE]
		[24 = CellVAlignment(%H,%C) = %VALUE]
		[25 = CellMerge(%H,%C) = %VALUE]
		[26 = CellBold(%H,%C) = %VALUE]
		[27 = CellItalic(%H,%C) = %VALUE]
		[28 = CellUnderline(%H,%C) = %VALUE]
		[29 = CellStrikeOut(%H,%C) = %VALUE]
		[30 = CellForeColor(%H,%C) = %VALUE]
		[31 = CellBackColor(%H,%C) = %VALUE]
		[32 = CellPicture(%H,%C) = %VALUE]
		[33 = CellPictureWidth(%H,%C) = %VALUE]
		[34 = CellPictureHeight(%H,%C) = %VALUE]
		[35 = CellData(%H,%C) = %VALUE]
		[110 = CellEditor(%H,%C)]
			Appearance = 0
			ButtonWidth = 13
			DropDownAlignment = 0
			DropDownAutoWidth = -1
			DropDownMinWidth = 164
			DropDownRows = 7
			DropDownVisible = -1
			EditType = 0
			Locked = 0
			Mask = ""
			MaskChar = 95
			Numeric = 0
			Option(37) = 0
			Option(39) = 0
			Option(103) = 24
			Option(104) = "7,8,9,/,C\r\n4,5,6,*,1/x\r\n1,2,3,-,sqrt\r\n0,+/-,.,+,="
			Option(102) = 24
			Option(101) = "Cannot divide by zero."
			Option(100) = -1
			Option(106) = ""
			Option(105) = ""
			Option(15) = 0
			Option(16) = 1
			Option(17) = 2
			Option(4) = 0
			Option(5) = -1
			Option(6) = -1
			Option(14) = -1
			Option(32) = 0
			Option(34) = 0
			Option(30) = "January February March April May June July August September October November December"
			Option(35) = -1
			Option(33) = -1
			Option(29) = "Today"
			Option(31) = "S M T W T F S"
			Option(47) = 0
			Option(23) = -1
			Option(28) = -1
			Option(46) = 46
			Option(36) = 0
			Option(50) = -2147483633
			Option(51) = 0
			Option(18) = 0
			Option(19) = 42
			Option(10) = 0
			Option(49) = -1
			Option(48) = 0
			Option(25) = -1
			Option(38) = 0
			Option(24) = -1
			Option(45) = 0
			Option(20) = -1
			Option(3) = -1
			Option(9) = -1
			Option(8) = 116
			Option(7) = 128
			Option(1) = 0
			Option(2) = 0
			Option(27) = -1
			Option(26) = -1
			Option(12) = 0
			Option(11) = -2147483635
			Option(13) = -1
			Option(21) = -1
			Option(52) = -1
			Option(44) = 100
			Option(43) = 0
			Option(42) = 1
			Option(41) = 64
			Option(40) = 1
			Option(22) = -1
			PartialCheck = 0
			PopupAppearance = 6
			[0 = AddButton(%BUTTON)]
			[1 = AddItem(%ITEM)]
				[4 = ItemTooltip(%VALUE) = %TOOLTIP]
			[2 = InsertItem(%ITEM)]
				[4 = ItemTooltip(%VALUE) = %TOOLTIP]
			[3 = ExpandAll]
			[5 = UserEditor(%CONTROL,%LICENSE)]
		[1000 = ExpandItem(%H) = %VALUE]
		[1001 = SelectItem(%H) = %VALUE]
		[1002 = ItemHeight(%H) = %VALUE]
		[1003 = ItemDivider(%H) = %VALUE]
		[1004 = ItemDividerLine(%H) = %VALUE]
		[1005 = ItemDividerLineAlignment(%H) = %VALUE]
		[1006 = ItemHasChildren(%H) = %VALUE]
		[1007 = ItemBold(%H) = %VALUE]
		[1008 = ItemItalic(%H) = %VALUE]
		[1009 = ItemUnderline(%H) = %VALUE]
		[1010 = ItemStrikeOut(%H) = %VALUE]
		[1011 = ItemForeColor(%H) = %VALUE]
		[1012 = ItemBackColor(%H) = %VALUE]
		[1013 = SelectableItem(%H) = %VALUE]
		[1014 = ItemData(%H) = %VALUE]
		[1015 = ExpandCard(%H) = %VALUE]
[2 = ApplyFilter]
ScrollPos(0) = 0
ScrollPos(-1) = 0
[0 = EndUpdate]

The indentation in the template is very important, so please make sure that you respect the indentation of the inside objects and properties. If an item in the template is indented it is related to the parent item/object. 

Let's say that you need only the items creating on the template like follows:

BeginUpdate
Items
{
	Dim h0
	h0 = AddItem("Number")
	CellValue(h0,1) = "Is Not"
	CellValue(h0,2) = "aaa"
	CellData(h0,0) = 2
	CellData(h0,1) = 18
	CellData(h0,2) = "aaa"
}
EndUpdate 

In this case the DefaultTemplate parameter should be:

[0 = BeginUpdate]
Items
	[0 = %H = %ADD(%VALUE)]
		[10 = CellValue(%H,%C) = %VALUE]
		[35 = CellData(%H,%C) = %VALUE]
[0 = EndUpdate]

in VB this is translated to:

Dim dt As String
dt = dt + "[0 = BeginUpdate]" + vbCrLf
dt = dt + "Items" + vbCrLf
dt = dt + vbTab + "[0 = %H = %ADD(%VALUE)]" + vbCrLf
dt = dt + vbTab + vbTab + "[10 = CellValue(%H,%C) = %VALUE]" + vbCrLf
dt = dt + vbTab + vbTab + "[35 = CellData(%H,%C) = %VALUE]" + vbCrLf
dt = dt + "[0 = EndUpdate]"
Debug.Print Grid1.ToTemplate(dt)

For instance, let's say that we need to save the layout ( size and position ) of the columns ( 4 columns ) in the control. In this case, we need to define a new DefaultTemplate parameter that includes only the Columns section as follows:

Columns
	Item(0)
		Position
		Width = 64
	Item(1)
		Position
		Width = 64
	Item(2)
		Position
		Width = 64
	Item(3)
		Position
		Width = 64

In other words, the DefaultTemplate parameter holds the default values for properties in the control, including inside objects. Using the ToTemplate property and the ExPropertiesList browser you can write template files easily.