ASPxClientListEditCustomHighlightingEventArgs.highlighting Property

Specifies rules according to which the editor highlights the filtered items.

Declaration

highlighting: any

Property Value

Type Description
any

An object representing the highlighting rules.

Remarks

Use the highlighting property to specify the custom highlighting logic on the client side.

In callback mode, the ASPxClientListEditCustomHighlightingEventArgs.highlighting property's default value is obtained from the ListEditCustomFilteringEventArgs.CustomHighlighting property if the latter is specified in the ASPxAutoCompleteBoxBase.CustomFiltering event. If the callback mode is disabled or the ListEditCustomFilteringEventArgs.CustomHighlighting property is not specified, the ASPxClientListEditCustomHighlightingEventArgs.highlighting property default value is null.

The highlighting property can be specified in the following ways.

  • Highlights all occurrences of the case-insensitive search text (the ASPxClientListEditCustomHighlightingEventArgs.filter property) in the filtered items.

    function onCustomHighlighting(s, e) {
        e.highlighting = e.filter;
    }
    
  • Highlights all instances of the "Custom text" string among the filtered items.

    function onCustomHighlighting(s, e) {
        e.highlighting = "Custom text";
    }
    
  • Highlights all instances of the "str1" and "str2" strings among the filtered items.

    function onCustomHighlighting(s, e) {
        e.highlighting = ["str1", "str2"];
    }
    
  • Highlights the "text" string followed by one or more occurrences of the "a", "b" and "c" letters (specified by the regular expression) among the filtered items.

    function onCustomHighlighting(s, e) {
        e.highlighting = /text[a-c]/gi;
    }
    
  • Highlights all instances of the "str1" string in the "Column1" and "str2" string in the "Column2" among the filtered items.

    function onCustomHighlighting(s, e) {
        e.highlighting = { "Column1": "str1", "Column2": "str2" };
    }
    
  • Highlights all instances of the "str1" and "str2" in the "Column1" and the "text" string followed by one or more occurrences of the "a", "b" and "c" letters in the "Column2" (specified by the regular expression) among the filtered items.

    function onCustomHighlighting(s, e) {
        e.highlighting = { "Column1": ["str1", "str2"], "Column2": new RegEx("text[a-c]+", "gi") } ;
    }
    
NOTE

Setting the highlighting property to a non-nullable value disables the default highlighting that is based on the TextFormatString property.

See Also