Skip to main content

Common Properties of List box and Drop-down Lists:




Property
Description
Items
The collection of ListItem objects that represents the items in the control. This property returns an object of type ListItemCollection.
Rows
Specifies the number of items displayed in the box. If actual list contains more rows than displayed then a scroll bar is added.
SelectedIndex
The index of the currently selected item. If more than one item is selected, then the index of the first selected item. If no item is selected, the value of this property is -1.
SelectedValue
The value of the currently selected item. If more than one item is selected, then the value of the first selected item. If no item is selected, the value of this property is an empty string("").
SelectionMode
Indicates whether a list box allows single selections or multiple selections.

Comments

Popular posts from this blog

List Controls: List Box and Drop Downlist

ASP.Net provides the controls: drop-down list, list box, radio button list, check box list and bulleted list. These control let a user choose from one or more items from the list. List boxes and drop-down list contain one or more list items. These lists could be loaded either by code or by the ListItem Collection Editor. Basic syntax for list box control: <asp:ListBox ID="ListBox1"        runat="server"        AutoPostBack="True"        OnSelectedIndexChanged="ListBox1_SelectedIndexChanged"> </asp:ListBox> Basic syntax for a drop-down list control: <asp:DropDownList ID="DropDownList1"       runat="server"       AutoPostBack="True"       OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged"> </asp:DropDownList>

Sql CharIndex Function

The CHARINDEX  function returns the starting position of the specified expression in a character string. Example: Search for "t" in string "DotNetReceipe", and return position: SELECT CHARINDEX( 't' , 'DotNetReceipe' ) AS Position;