Spread ASP.NET 6.0 Product Documentation
ListItems Property
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > ListBoxCellType Class : ListItems Property


Glossary Item Box

Gets or sets the list of items.

Syntax

Visual Basic (Declaration) 
Public Property ListItems As ListItem()
Visual Basic (Usage)Copy Code
Dim instance As ListBoxCellType
Dim value() As ListItem
 
instance.ListItems = value
 
value = instance.ListItems
C# 
public ListItem[] ListItems {get; set;}

Property Value

ListItem array containing the list of items

Remarks

This property is available at run time only.

Example

This example creates a list box cell type and assigns it to the first cell in the sheet with a list of three items and displays two of them at any time.
C#Copy Code
      FarPoint.Web.Spread.ListBoxCellType list = new FarPoint.Web.Spread.ListBoxCellType();
	FarPoint.Web.Spread.ListItem[] items = new FarPoint.Web.Spread.ListItem[3]; 
	FarPoint.Web.Spread.ListItem item = new FarPoint.Web.Spread.ListItem(); 
	item.Text = "First"; 
	item.Value = "Gold"; 
	items[0] = item; 
	item = new FarPoint.Web.Spread.ListItem(); 
	item.Text = "Second"; 
	item.Value = "Silver"; 
	items[1] = item; 
	item = new FarPoint.Web.Spread.ListItem(); 
	item.Text = "Third"; 
	item.Value = "Bronze"; 
	items[2] = item; 
	list.ListItems = items;
      // number of items to display in list
	list.Rows = 2;
	FpSpread1.Sheets[0].Cells[0,0].CellType = list;
Visual BasicCopy Code
	Dim list As New FarPoint.Web.Spread.ListBoxCellType()
	Dim item As New FarPoint.Web.Spread.ListItem()
	Dim items(3) As FarPoint.Web.Spread.ListItem
	item.Text = "First"
	item.Value = "Gold"
	items(0) = item
	item = New FarPoint.Web.Spread.ListItem()
	item.Text = "Second"
 	item.Value = "Silver"
	items(1) = item
	item = New FarPoint.Web.Spread.ListItem()
	item.Text = "Third"
	item.Value = "Bronze"
	items(2) = item 
	list.ListItems = items
	' number of items to display in list
	list.Rows = 2
	FpSpread1.Sheets(0).Cells(0, 0).CellType = list

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.