asp.net.ph

ListBox.Rows Property

System.Web.UI.WebControls Namespace   ListBox Class


Sets or retrieves the number of rows displayed in a ListBox control.

Syntax


Inline <asp:listbox rows = intRows ... >
Script ListBox.Rows [ = intRows ]

Property Value


intRows Integer specifying the display height, in rows, of the list box.

The property is read/write with a default value of 4.

Exceptions


Exception Type Condition
ArgumentOutOfRangeException The given number of rows is less than one or greater than 2000.

Remarks

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

This property specifies the number of visible rows. Users may select from more items than specified, and browsers typically provide some means to scroll through the contents of the control when the contents extend beyond the visible area.

Example

The following shows how to declaratively set the Rows property of a ListBox control at design time.

<asp:listbox id = "AvailableFonts" class = "lists" 
      selectionmode = "multiple" rows=8 runat = "server">
   <asp:listitem>Roman</asp:listitem>
   <asp:listitem>Arial Black</asp:listitem>
   <asp:listitem>Garamond</asp:listitem>
   <asp:listitem>Somona</asp:listitem>
   <asp:listitem>Symbol</asp:listitem>
</asp:listbox>

 Show me 

See Also

ListBox Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph