PowerTools MultiRow for Windows Forms 8.0J
エラーアイコンによる通知(IconNotify)

IconNotifyを使用すると、検証エラーをエラーアイコンの表示で通知できます。エラーアイコンの種類、表示位置、ツールチップは変更できます。
IconNotifyはGcMultiRow.ShowErrorIconInEditingStatusプロパティの影響を受けません。
デザイナによる設定
デザイナでセルの検証と共にIconNotifyを使用するには、次のように操作します。

  1. 値を検証するセルを選択する。(例: textBoxCell1)
  2. プロパティウィンドウでValidatorsプロパティを選択し、[...]ボタンをクリックする。
  3. 表示されたCellValidatorコレクションエディタで左上のコンボボックスから「RequiredFieldValidator」を選択し、[追加]をクリックする。
  4. 画面右のプロパティグリッドでActionsプロパティを選択し、[...]ボタンをクリックする。
  5. 表示されたCellValidateActionコレクションエディタでIconNotifyを追加する。
  6. [OK]ボタンをクリックしてCellValidateActionコレクションエディタを閉じる。
  7. [OK]ボタンをクリックしてCellValidatorコレクションエディタを閉じる。
  8. デザイナのドキュメントウィンドウのタブを「実行時」に切り替える。
  9. textBoxCell1を変更せずに次のセルに移動して検証エラーが表示されることを確認する。
コーディングによる設定
次のコードは、文字列型セルの値が空白のとき検証エラーとしてエラーアイコンを表示します。

Imports GrapeCity.Win.MultiRow

Dim TextBoxCell1 As New TextBoxCell()
Dim RequiredFieldValidator1 As New RequiredFieldValidator()
RequiredFieldValidator1.Actions.Add(New IconNotify())
TextBoxCell1.Validators.Add(RequiredFieldValidator1)

Dim cells As Cell() = {TextBoxCell1}
GcMultiRow1.Template = Template.CreateGridTemplate(cells)
GcMultiRow1.RowCount = 10
using GrapeCity.Win.MultiRow;

TextBoxCell textBoxCell1 = new TextBoxCell();
RequiredFieldValidator requiredFieldValidator1 = new RequiredFieldValidator();
requiredFieldValidator1.Actions.Add(new IconNotify());
textBoxCell1.Validators.Add(requiredFieldValidator1);

Cell[] cells = { textBoxCell1 };
gcMultiRow1.Template = Template.CreateGridTemplate(cells);
gcMultiRow1.RowCount = 10;
   
参照

 

 


© 2008-2015 GrapeCity inc. All rights reserved.