FlexPivot for WinForms
ValidateEdit イベント (C1FlexGridBase)
使用例 

C1.Win.C1FlexGrid.4.5.2 アセンブリ > C1.Win.C1FlexGrid 名前空間 > C1FlexGridBase クラス : ValidateEdit イベント
Fires before the control exits cell edit mode, while the editor is still active.
シンタックス
'宣言
 
Public Event ValidateEdit As ValidateEditEventHandler
public event ValidateEditEventHandler ValidateEdit
イベント データ

イベント ハンドラが、このイベントに関連するデータを含む、ValidateEditEventArgs 型の引数を受け取りました。次の ValidateEditEventArgs プロパティには、このイベントの固有の情報が記載されます。

プロパティ解説
Gets or sets a value indicating whether the edit operation should be canceled.  
If the cell contains a checkbox, the new checkbox state about to be applied to the cell.  
Gets the column index of the cell being edited.  
Gets or sets a value describing a reason why validation of editor value failed.  
Gets the row index of the cell being edited.  
解説

When this event fires, the contents of the editor have not been applied to the grid. You can validate the editor contents and cancel the edits if necessary.

To validate the editor contents, check the value contained in the Editor.Text property. If the value is invalid for the cell, set the Cancel parameter to true and the grid will remain in edit mode until the user types a valid entry.

For example, the code below checks to make sure the value entered is an integer between 0 and 100: void _flex_ValidateEdit(object sender, ValidateEditEventArgs e) { if (_flex.Cols[e.Col].Name = "Score") { try { int value = int.Parse(_flex.Editor.Text); if (value >= 0 && value <= 50) return; // accept edits } catch {} // error or invalid range, refuse edits e.Cancel = true; } }
使用例
For example, the code below checks to make sure the value entered is an integer between 0 and 100:
void _flex_ValidateEdit(object sender, ValidateEditEventArgs e)
{
    if (_flex.Cols[e.Col].Name = "Score")
    {
        try
        {
            int value = int.Parse(_flex.Editor.Text);
            if (value >= 0 && value <= 50)
                return; // accept edits
        }
        catch {}
    
        // error or invalid range, refuse edits
        e.Cancel = true;
    }
}
参照