'宣言 Public Overridable Property ValueList As Infragistics.Win.IValueList
public virtual Infragistics.Win.IValueList ValueList {get; set;}
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
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; }