バージョン

SetHeaderCheckedState(RowsCollection,Boolean) メソッド

提供された RowsCollection Header の CheckState を設定します。
シンタックス
'宣言
 
Public Overloads Sub SetHeaderCheckedState( _
   ByVal rows As RowsCollection, _
   ByVal check As Boolean _
) 
public void SetHeaderCheckedState( 
   RowsCollection rows,
   bool check
)

パラメータ

rows
変更するヘッダーを含む RowsCollection
check
ヘッダー チェック卜すをチェックするかどうかを示します。
使用例
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);
}
参照