GrapeCity MultiRow Windows Forms Documentation
RowCount Property (GcMultiRow)
Example 


Gets or sets the number of rows displayed in the GcMultiRow control.
Syntax
<SRCategoryAttribute("Data")>
<SRDescriptionAttribute("Indicates the number of rows displayed in the GcMultiRow.")>
<FeatureAttribute(Name="General", Version="v5.0")>
<FeatureAttribute(Name="VirtualMode", Version="v5.0")>
Public Property RowCount As Integer
Dim instance As GcMultiRow
Dim value As Integer
 
instance.RowCount = value
 
value = instance.RowCount
[SRCategory("Data")]
[SRDescription("Indicates the number of rows displayed in the GcMultiRow.")]
[Feature(Name="General", Version="v5.0")]
[Feature(Name="VirtualMode", Version="v5.0")]
public int RowCount {get; set;}

Property Value

A System.Int32 value that represents the number of rows to display in the GcMultiRow control.
Exceptions
ExceptionDescription
System.InvalidOperationException

When setting this property, the DataSource property is set.

-or-

When setting this property, the Template property is a null reference (Nothing in Visual Basic).

System.ArgumentOutOfRangeException

The specified value when setting this property is less than 0.

-or-

The specified value is less than 1 and AllowUserToAddRows is set to true.

Remarks

In unbound and virtual mode, if the RowCount property is set to a value less than the current value, rows are removed from the end of the Rows collection. If RowCount is set to a value greater than the current value, rows are added to the end of the Rows collection. The additional rows are based on the row specified in the Template's Template.Row property. This property cannot be set in DataBinding mode.

If you set the RowCount property to 0, all rows are removed from the GcMultiRow control. This is equivalent to calling the RowCollection.Clear method. If AllowUserToAddRows is true, you cannot set RowCount to 0. In this case, call the RowCollection.Clear method to remove all rows except the row for new records. Calling Clear has the same result as setting RowCount to 1 in this case, but is much faster.

Example
This example sets the RowCount property.
GrapeCity.Win.MultiRow.TextBoxCell text1 = new GrapeCity.Win.MultiRow.TextBoxCell();
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()
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

GcMultiRow Class
GcMultiRow Members

 

 


Copyright © GrapeCity, inc. All rights reserved.