Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The duplicate rule checks for duplicate values.Duplicate 规则用于检查单元格中重复的值。

Using Code
This example creates a duplicate rule示例代码
以下 代码使用了 duplicate 规则.

JavaScript

Copy Code

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="598f3f84-e88f-4a5b-9504-e78668c5157d"><ac:plain-text-body><![CDATA[

var style = new GC.Spread.Sheets.Style();style.backColor = "yellow";var ranges=[new GC.Spread.Sheets.Range(0,0,10,1)];activeSheet.conditionalFormats.addDuplicateRule(style, ranges);activeSheet.setValue(0, 0, 50);activeSheet.setValue(1, 0, 50);activeSheet.setValue(2, 0, 11);activeSheet.setValue(3, 0, 5);// ORvar style = new GC.Spread.Sheets.Style();style.backColor = "yellow";var rule = new GC.Spread.Sheets.ConditionalFormatting.NormalConditionRule(); rule.ruleType(GC.Spread.Sheets.ConditionalFormatting.RuleType.DuplicateRule);rule.ranges([new GC.Spread.Sheets.Range(0,0,10,1)]);rule.style(style);activeSheet.conditionalFormats.addRule(rule);activeSheet.setValue(0, 0, 50);activeSheet.setValue(1, 0, 50);activeSheet.setValue(2, 0, 11);activeSheet.setValue(3, 0, 5);

 

]]></ac:plain-text-body></ac:structured-macro>

See Also另见
addDuplicateRule Method
addRule Method
NormalConditionRule class
RuleType Enumeration