GrapeCity MultiRow Windows Forms Documentation
Lines Property
Example 


Gets or sets the lines of text in a TextBoxCell.
Syntax
<SRDescriptionAttribute("Indicates the lines of text in a multiline edit, as an array of String values.")>
<SRCategoryAttribute("Appearance")>
<MergablePropertyAttribute(False)>
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)>
Public Property Lines As String()
Dim instance As TextBoxCell
Dim value() As String
 
instance.Lines = value
 
value = instance.Lines
[SRDescription("Indicates the lines of text in a multiline edit, as an array of String values.")]
[SRCategory("Appearance")]
[MergableProperty(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] Lines {get; set;}

Property Value

A System.String array value that contains the text in a TextBoxCell.
Remarks

Each element in the array becomes a line of text in the text box cell. If the Multiline property of the text box control is set to true and a newline character appears in the text, the text following the newline character is added to a new element in the array and displayed on a separate line.

Notes
The collection of lines this property returns is a read-only copy of the lines in the TextBoxCell.

Example
This example sets the Lines property.
GrapeCity.Win.MultiRow.TextBoxCell text1 = new GrapeCity.Win.MultiRow.TextBoxCell();
text1.Style.Multiline = GrapeCity.Win.MultiRow.MultiRowTriState.True;
// Increase the row height to see multiple lines
text1.Lines = new System.String[] {"1", "test"};
GrapeCity.Win.MultiRow.TextBoxCell text2 = new GrapeCity.Win.MultiRow.TextBoxCell();
text1.Name = "text1";
text2.Name = "text2";
GrapeCity.Win.MultiRow.Template template1 = GrapeCity.Win.MultiRow.Template.CreateGridTemplate(new GrapeCity.Win.MultiRow.Cell[] { text1, text2 }, 160, GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.ColumnHeader | GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.RowHeaderAutoNumber);
template1.ColumnHeaders[0].Cells[0].Value = "Column1";
template1.ColumnHeaders[0].Cells[1].Value = "Column2";
gcMultiRow1.Template = template1;
gcMultiRow1.RowCount = 3;
Dim text1 As New GrapeCity.Win.MultiRow.TextBoxCell()
text1.Style.Multiline = GrapeCity.Win.MultiRow.MultiRowTriState.True
'Increase the row height to see multiple lines
text1.Lines = New System.String() {"1", "test"}
Dim text2 As New GrapeCity.Win.MultiRow.TextBoxCell()
text1.Name = "text1"
text2.Name = "text2"
Dim template1 As GrapeCity.Win.MultiRow.Template = GrapeCity.Win.MultiRow.Template.CreateGridTemplate(New GrapeCity.Win.MultiRow.Cell() {text1, text2}, 160, GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.ColumnHeader Or GrapeCity.Win.MultiRow.AutoGenerateGridTemplateStyles.RowHeaderAutoNumber)
template1.ColumnHeaders(0).Cells(0).Value = "Column1"
template1.ColumnHeaders(0).Cells(1).Value = "Column2"
GcMultiRow1.Template = template1
GcMultiRow1.RowCount = 3
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

TextBoxCell Class
TextBoxCell Members

 

 


Copyright © GrapeCity, inc. All rights reserved.