Version

Add(Object,String) Method

Adds an item to the collection
Syntax
'Declaration
 
Public Overloads Function Add( _
   ByVal dataValue As Object, _
   ByVal displayText As String _
) As ValueListItem
public ValueListItem Add( 
   object dataValue,
   string displayText
)

Parameters

dataValue
The value to compare
displayText
The display text

Return Value

The newly added item
Example
This sample creates a valuelist with four items. It initializes its appearance and selected index, sorts it by dataValue, and assigns it to the first column of the grid.

Imports Infragistics.Win

Private Sub CreateValueList()

    Dim list As ValueList = New ValueList()

    list.ValueListItems.Add(1, "One")
    list.ValueListItems.Add(2, "Two")
    list.ValueListItems.Add(3, "Three")
    list.ValueListItems.Add(4, "Four")
    list.Appearance.BackColor = Color.Green
    list.SelectedIndex = 2
    list.SortStyle = ValueListSortStyle.AscendingByValue

    Me.UltraGrid1.DisplayLayout.Bands(0).Columns(0).ValueList = list
    Me.UltraGrid1.DisplayLayout.Bands(0).Columns(0).Style = UltraWinGrid.ColumnStyle.DropDownList

End Sub
using Infragistics.Win;

private void CreateValueList()
{

	ValueList list = new ValueList();

	list.ValueListItems.Add(1,"One");
	list.ValueListItems.Add(2,"Two");
	list.ValueListItems.Add(3,"Three");
	list.ValueListItems.Add(4,"Four");
	list.Appearance.BackColor = Color.Green;
	list.SelectedIndex = 2;
	list.SortStyle = ValueListSortStyle.AscendingByValue ;

	this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].ValueList = list;
	this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Style = UltraWinGrid.ColumnStyle.DropDownList ;

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, 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