Version

SelectedIndex Property (ValueList)

Gets/sets the index of the currently selected item. Available only at runtime.
Syntax
'Declaration
 
Public Property SelectedIndex As Integer
public int SelectedIndex {get; set;}
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