GrapeCity MultiRow Windows Forms Documentation
Notification using Three-State Icon

You can use the ThreeStateIconNotify class to notify the user of an error by displaying an icon when the input value is valid and when it is invalid. In addition, the icon is not shown if nothing is entered.

Using the Designer

Use the following steps to use three-state notification for cell validation.

  1. Select a cell value to validate (for example, numericUpDownCell1).
  2. From the Properties window, select the Validators property and click the ... button.
  3. From the CellValidator collection editor, select RangeValidator from the left-top combo box and click the Add button.
  4. From the Members list, confirm that RangeValidator has been selected.
  5. Select the MaxValue property from the property grid and type 10.
  6. Select the MinValue property from the property grid and type 0.
  7. Click the OK button and close the window.
  8. Select the Actions property from the property grid and click the ... button.
  9. Add ThreeStateIconNotify in the CellValidateAction collection editor.
  10. From the Members list, confirm that ThreeStateIconNotify has been selected. Set the DoActionReason property in the property grid to EndEdit.
  11. Click the OK button to close the CellValidateAction collection editor.
  12. Click the OK button to close the CellValidator collection editor.
  13. Change the document window tab of the designer to Runtime.
  14. Enter 20 in the numericUpDownCell1 and check that the error icon is displayed when you move to another cell.
  15. Enter 5 in the numericUpDownCell1 and check that the icon for the valid value is displayed when you move to another cell.

Using Code

The following code displays the error icon when a value outside the range of 0 to 10 is entered in the cell, and displays the icon for a valid value when a value within the range of 0 to 10 is entered.

[VB]

Imports GrapeCity.Win.MultiRow 
Dim numericUpDownCell1 As New NumericUpDownCell() 
Dim rangeValidator1 As New RangeValidator()
rangeValidator1.RequiredType = GetType(Integer) 
rangeValidator1.MaxValue = 10 
rangeValidator1.MinValue = 0 
rangeValidator1.Actions.Add(New ThreeStateIconNotify()) 
numericUpDownCell1.Validators.Add(rangeValidator1) 
Dim cells As Cell() = {numericUpDownCell1} GcMultiRow1.Template = Template.CreateGridTemplate(cells) 
GcMultiRow1.RowCount = 10

[CS]

using GrapeCity.Win.MultiRow; 
NumericUpDownCell numericUpDownCell1 = new NumericUpDownCell(); 
RangeValidator rangeValidator1 = new RangeValidator(); 
rangeValidator1.RequiredType = typeof(int);
rangeValidator1.MaxValue = 10; 
rangeValidator1.MinValue = 0; 
rangeValidator1.Actions.Add(new ThreeStateIconNotify());
numericUpDownCell1.Validators.Add(rangeValidator1); 
Cell[] cells = { numericUpDownCell1 }; 
gcMultiRow1.Template = Template.CreateGridTemplate(cells);
gcMultiRow1.RowCount = 10;
The BlinkRate, BlinkStyle, and IconPadding properties that are available in the ThreeStateIconNotify property of InputMan are not supported.
See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options