バージョン

CheckStateMember プロパティ

EditorValueSource プロパティが CheckedItems に設定されている場合は、コントロールの Value を定義する column のキーを取得または設定します。
シンタックス
'宣言
 
Public Property CheckStateMember As String
public string CheckStateMember {get; set;}
例外
例外解説
System.ExceptionCheckStateMember プロパティは ValueMember と同じ値に設定された場合は、発生されます。
解説

CheckStateMember プロパティが設定されていないまたは既存しない列に設定されている場合は、base クラスの他のプロパティが適用できなくて、このインスタンスのすべての他のプロパティがデフォルト値に設定されると同じように動作します。

CheckStateMember プロパティは ブール列を参照する必要がありませんが、列のデータ型はブール値のデータ型と変換できるタイプである必要があります。たとえば、CheckBox の style を提供して、この列の値がブール値 (True または False) に変換できる場合は、string のデータ型の列を使用できます。

CheckStateMember 列の値が True である rows のコレクションは CheckedRows コレクションに返されます。

使用例
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinEditors
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

Public Class Form1
    Private _table As DataTable

    Public Sub New()

        Me.InitializeComponent()

        '   Bind the UltraComboEditor control to a data source.
        Me.ultraComboEditor1.DisplayMember = "Display"
        Me.ultraComboEditor1.ValueMember = "Value"
        Me.ultraComboEditor1.DataSource = Me.Table

        '   Bind the UltraCombo control to a data source.
        Me.ultraCombo1.DisplayMember = "Display"
        Me.ultraCombo1.ValueMember = "Value"
        Me.ultraCombo1.DataSource = Me.Table

    End Sub

    Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
        MyBase.OnLoad(e)

        '  Set up the UltraComboEditor to show checkboxes next to the items, with middle-left alignment
        Me.ultraComboEditor1.CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox
        Me.ultraComboEditor1.CheckedListSettings.CheckBoxAlignment = ContentAlignment.MiddleLeft

        '  Set up the UltraCombo to show its checkbox column on the left, with the checkbox middle-center aligned
        Me.ultraCombo1.CheckedListSettings.CheckStateMember = "Selected"
        Dim column As UltraGridColumn = Me.ultraCombo1.DisplayLayout.Bands(0).Columns("Selected")
        Dim checkEditor As CheckEditor = New CheckEditor()
        checkEditor.CheckAlign = ContentAlignment.MiddleCenter
        column.Editor = CheckEditor
        column.Header.VisiblePosition = 0

        '  Set up both controls to get their value from the checked items/rows
        Me.ultraComboEditor1.CheckedListSettings.EditorValueSource = EditorWithComboValueSource.CheckedItems
        Me.ultraCombo1.CheckedListSettings.EditorValueSource = EditorWithComboValueSource.CheckedItems

        '  Set up both controls so that clicking anywhere on the item changes the check state,
        '  and does not close the dropdown until the enter/escape key is pressed
        Me.ultraComboEditor1.CheckedListSettings.ItemCheckArea = ItemCheckArea.Item
        Me.ultraCombo1.CheckedListSettings.ItemCheckArea = ItemCheckArea.Item

        '  Set up both controls to use a custom list delimiter
        Me.ultraComboEditor1.CheckedListSettings.ListSeparator = " / "
        Me.ultraCombo1.CheckedListSettings.ListSeparator = " / "

        '  Handle the ValueChanged event for each control
        AddHandler Me.ultraComboEditor1.ValueChanged, AddressOf Me.OnValueChanged
        AddHandler Me.ultraCombo1.ValueChanged, AddressOf Me.OnValueChanged

    End Sub

    Private Sub OnValueChanged(ByVal sender As Object, ByVal e As EventArgs)

        '  Get the list of values from each control, and a reference
        '  to their IValueList implementation so we can get the text
        '  for each item.
        Dim values As System.Collections.IList = Nothing
        Dim valueList As IValueList = Nothing

        If sender Is Me.ultraComboEditor1 Then
            values = Me.ultraComboEditor1.Value
            valueList = Me.ultraComboEditor1.Items.ValueList

        ElseIf sender Is Me.ultraCombo1 Then
            values = Me.ultraCombo1.Value
            valueList = Me.ultraCombo1
        End If

        '  Iterate the list of values and output each one to the console
        If Not values Is Nothing Then

            Dim index As Int32 = -1

            Dim value As Object
            For Each value In values
                Dim text As String = valueList.GetText(value, index)
                Console.WriteLine(String.Format("Text = '{0}', Value = '{1}'", text, value))
            Next

        End If
    End Sub


    Private ReadOnly Property Table() As DataTable
        Get
            If Me._table Is Nothing Then
                Me._table = New DataTable()
                Me._table.Columns.Add("Value", GetType(Object))
                Me._table.Columns.Add("Display", GetType(String))
                Me._table.Columns.Add("Selected", GetType(Boolean))

                Me._table.Rows.Add(New Object() {1, "One", False})
                Me._table.Rows.Add(New Object() {2, "Two", False})
                Me._table.Rows.Add(New Object() {3, "Three", False})
                Me._table.Rows.Add(New Object() {4, "Four", False})
                Me._table.Rows.Add(New Object() {5, "Five", False})
            End If

            Return Me._table
        End Get
    End Property
End Class
using Infragistics.Win;
using Infragistics.Win.UltraWinEditors;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

public partial class Form1 : Form
{
    private DataTable table = null;

    public Form1()
    {
        this.InitializeComponent();

        //  Bind the UltraComboEditor control to a data source.
        this.ultraComboEditor1.DisplayMember = "Display";
        this.ultraComboEditor1.ValueMember = "Value";
        this.ultraComboEditor1.DataSource = this.Table;

        //  Bind the UltraCombo control to a data source.
        this.ultraCombo1.DisplayMember = "Display";
        this.ultraCombo1.ValueMember = "Value";
        this.ultraCombo1.DataSource = this.Table;
    }

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);

        //  Set up the UltraComboEditor to show checkboxes next to the items, with middle-left alignment
        this.ultraComboEditor1.CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox;
        this.ultraComboEditor1.CheckedListSettings.CheckBoxAlignment = ContentAlignment.MiddleLeft;

        //  Set up the UltraCombo to show its checkbox column on the left, with the checkbox middle-center aligned
        this.ultraCombo1.CheckedListSettings.CheckStateMember = "Selected";
        UltraGridColumn column = this.ultraCombo1.DisplayLayout.Bands[0].Columns["Selected"];
        CheckEditor checkEditor = new CheckEditor();
        checkEditor.CheckAlign = ContentAlignment.MiddleCenter;
        column.Editor = checkEditor;
        column.Header.VisiblePosition = 0;

        //  Set up both controls to get their value from the checked items/rows
        this.ultraComboEditor1.CheckedListSettings.EditorValueSource = EditorWithComboValueSource.CheckedItems;
        this.ultraCombo1.CheckedListSettings.EditorValueSource = EditorWithComboValueSource.CheckedItems;

        //  Set up both controls so that clicking anywhere on the item changes the check state,
        //  and does not close the dropdown until the enter/escape key is pressed
        this.ultraComboEditor1.CheckedListSettings.ItemCheckArea = ItemCheckArea.Item;
        this.ultraCombo1.CheckedListSettings.ItemCheckArea = ItemCheckArea.Item;

        //  Set up both controls to use a custom list delimiter
        this.ultraComboEditor1.CheckedListSettings.ListSeparator = " / ";
        this.ultraCombo1.CheckedListSettings.ListSeparator = " / ";

        //  Handle the ValueChanged event for each control
        this.ultraComboEditor1.ValueChanged += new EventHandler(this.OnValueChanged);
        this.ultraCombo1.ValueChanged += new EventHandler(this.OnValueChanged);
    }

    private void OnValueChanged(object sender, EventArgs e)
    {
        //  Get the list of values from each control, and a reference
        //  to their IValueList implementation so we can get the text
        //  for each item.
        System.Collections.IList values = null;
        IValueList valueList = null;

        if ( sender == this.ultraComboEditor1 )
        {
            values = this.ultraComboEditor1.Value as System.Collections.IList;
            valueList = this.ultraComboEditor1.Items.ValueList as IValueList;
        }
        else
        if ( sender == this.ultraCombo1 )
        {
            values = this.ultraCombo1.Value as System.Collections.IList;
            valueList = this.ultraCombo1 as IValueList;
        }

        //  Iterate the list of values and output each one to the console
        if ( values != null )
        {
            int index = -1;

            foreach( object value in values )
            {
                string text = valueList.GetText( value, ref index );
                Console.WriteLine( string.Format("Text = '{0}', Value = '{1}'", text, value) );
            }

        }
    }

    private DataTable Table
    {
        get
        {
            if ( this.table == null )
            {
                this.table = new DataTable();
                this.table.Columns.Add( "Value", typeof(object) );
                this.table.Columns.Add( "Display", typeof(string) );
                this.table.Columns.Add( "Selected", typeof(bool) );

                this.table.Rows.Add( new object[]{ 1, "One", false } );
                this.table.Rows.Add( new object[]{ 2, "Two", false } );
                this.table.Rows.Add( new object[]{ 3, "Three", false } );
                this.table.Rows.Add( new object[]{ 4, "Four", false } );
                this.table.Rows.Add( new object[]{ 5, "Five", false } );
            }

            return this.table;
        }
    }
}
参照