Infragistics(R) NetAdvantage(R) Windows Forms
ValueList Property
See Also  Example E-mail your feedback on this topic.
Infragistics.Win.UltraWinGrid Namespace > UltraGridCell Class : ValueList Property

Gets or sets the cell specific value list. Default is to use the UltraGridColumn.ValueList off the associated column. If this property is not set to a value list, it returns null.

Syntax

Visual Basic (Declaration) 
Public Overridable Property ValueList As Infragistics.Win.IValueList
C# 
public virtual Infragistics.Win.IValueList ValueList {get; set;}

Example

Following code sets ValueList property of a column and then overrides the ValueList for a cell in the same column.

Visual BasicCopy Code
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

    Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button2.Click
        Dim column As UltraGridColumn = Me.UltraGrid1.DisplayLayout.Bands(0).Columns(1)

        ' Create a value list.
        Dim vl1 As ValueList = New ValueList()
        vl1.ValueListItems.Add(1, "True")
        vl1.ValueListItems.Add(2, "False")

        ' Set vl1 to the column2. Cells in column2 will use this value list.
        column.ValueList = vl1

        ' Create another value list.
        Dim vl2 As ValueList = New ValueList()
        vl2.ValueListItems.Add(1, "Yes")
        vl2.ValueListItems.Add(2, "No")

        ' You can also set value list on an individual cell.
        Me.UltraGrid1.Rows(1).Cells(column).ValueList = vl2
    End Sub
C#Copy Code
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

		private void button2_Click(object sender, System.EventArgs e)
		{
			UltraGridColumn column = this.ultraGrid1.DisplayLayout.Bands[0].Columns[1];

			// Create a value list.
			ValueList vl1 = new ValueList( );
			vl1.ValueListItems.Add( 1, "True" );
			vl1.ValueListItems.Add( 2, "False" );
			
			// Set vl1 to the column2. Cells in column2 will use this value list.
			column.ValueList = vl1;

			// Create another value list.
			ValueList vl2 = new ValueList( );
			vl2.ValueListItems.Add( 1, "Yes" );
			vl2.ValueListItems.Add( 2, "No");

			// You can also set value list on an individual cell.
			this.ultraGrid1.Rows[1].Cells[column].ValueList = vl2;
		}

See Also