GrapeCity MultiRow Windows Forms Documentation
SurrogateCharValidator

You can use SurrogateCharValidator and validate if surrogate characters have been entered in the cell.

Using Designer

Complete the following steps to validate surrogate characters. The example displays a validation error if characters other than double byte katakana have been entered in textBoxCell.

  1. Select a cell for which to validate the value (for example, textBoxCell1).
  2. From the properties window, select the Validators property and click the ... button.
  3. From the displayed CellValidator collection editor, select SurrogateCharValidator from the top-left combo box and click the Add button.
  4. From the Members list, confirm that SurrogateCharValidator has been selected.
  5. Select the Actions property from the property grid and click the ... button.
  6. Add LineNotify in the displayed CellValidateAction collection editor.
  7. Click the OK button and close the CellValidateAction collection editor.
  8. Click the OK button and close the CellValidator collection editor.
  9. Change the document window tab of the designer to Runtime.
  10. Enter environment-dependent characters (for example, one of the conversion results of しかる(Japanese characters)).

Using Code

The following code displays a validation error when surrogate characters are entered into the cell.

[VB]

Imports GrapeCity.Win.MultiRow

Dim textBoxCell1 As New TextBoxCell()
Dim surrogateCharValidator1 As New SurrogateCharValidator()
surrogateCharValidator1.Actions.Add(New LineNotify())
textBoxCell1.Validators.Add(surrogateCharValidator1)

Dim cells As Cell() = {textBoxCell1}
GcMultiRow1.Template = Template.CreateGridTemplate(cells)
GcMultiRow1.RowCount = 10

[CS]

using GrapeCity.Win.MultiRow;

TextBoxCell textBoxCell1 = new TextBoxCell();
SurrogateCharValidator surrogateCharValidator1 = new SurrogateCharValidator();
surrogateCharValidator1.Actions.Add(new LineNotify());
textBoxCell1.Validators.Add(surrogateCharValidator1);

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

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options