バージョン

GetHeaderCheckedState メソッド

Header の現在の CheckState を返します。
シンタックス
'宣言
 
Public Function GetHeaderCheckedState( _
   ByVal rows As RowsCollection _
) As CheckState
public CheckState GetHeaderCheckedState( 
   RowsCollection rows
)

パラメータ

rows
関連付けられた Header の検索に使用される RowsCollection。

戻り値の型

CheckBox の Checked プロパティに基づいて CheckState を返します。
使用例
Private Sub ToggleHeaderCheckBox(ByRef column As UltraGridColumn, ByRef rows As RowsCollection) 
    
    ' Return if no UltraGridColumn is supplied 
    ' 
    If column Is Nothing Then 
        Exit Sub 
    End If 
    
    
    ' Flag to indicate the current check state 
    ' 
    Dim isChecked As Boolean = False 
    
    
    ' Retrieve the current CheckState of the Header CheckBox for the provided RowsCollection, 
    ' and set the isChecked flag 
    ' 
    Select Case column.GetHeaderCheckedState(rows) 
        Case CheckState.Checked 
            isChecked = True 
            Exit Select 
        Case CheckState.Unchecked 
            isChecked = False 
            Exit Select 
        Case Else 
            Exit Sub 
    ' Do nothing if Indeterminate 
    End Select 
    
    
    ' Set the CheckState of the Header CheckBox 
    ' 
    column.SetHeaderCheckedState(rows, Not isChecked) 
End Sub
private void ToggleHeaderCheckBox(UltraGridColumn column, RowsCollection rows)
{

    // Return if no UltraGridColumn is supplied
    //
    if (column == null)
        return;


    // Flag to indicate the current check state
    //
    bool isChecked = false;


    // Retrieve the current CheckState of the Header CheckBox for the provided RowsCollection,
    // and set the isChecked flag
    //
    switch (column.GetHeaderCheckedState(rows))
    {
        case CheckState.Checked:
            isChecked = true;
            break;
        case CheckState.Unchecked:
            isChecked = false;
            break;
        default:
            // Do nothing if Indeterminate
            return;
    }
    

    // Set the CheckState of the Header CheckBox
    //
    column.SetHeaderCheckedState(rows, !isChecked);
}
参照