ListBox::Rows Property

 

Gets or sets the number of rows displayed in the ListBox control.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
property int Rows {
	virtual int get();
	virtual void set(int value);
}

Property Value

Type: System::Int32

The number of rows displayed in the ListBox control. The default value is 4.

Exception Condition
ArgumentOutOfRangeException

The specified number of rows is less than one or greater than 2000.

Use the Rows property to specify the number of rows to display in the ListBox control.

System_CAPS_cautionCaution

The number of rows must be between one and 2000. Values outside of this range will raise an exception.

The value of the Rows property is stored in view state.

The following example demonstrates how to use the Rows property to display six rows in the ListBox control.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: