Skip to main content
A newer version of this page is available. .
Tab

ListEditCustomFilteringEventArgs.CustomHighlighting Property

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

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public ListEditCustomHighlighting CustomHighlighting { get; set; }

Property Value

Type Description
ListEditCustomHighlighting

A ListEditCustomHighlighting object representing the highlighting rules.

Remarks

Use the CustomHighlighting property to specify the custom highlighting logic. By default, if the ListEditCustomFilteringEventArgs.CustomHighlighting property is not set, the CustomFiltering event highlights the first occurrence for each character typed in the editor’s filtering area.

The CustomHighlighting property can be specified in the following ways.

  • Highlights all instances of the “str” string in the filtered items.

    
    e.CustomHighlighting = "str";
    
  • Highlights all instances of the “str1” and “str2” strings in the filtered items.

    
    e.CustomHighlighting = new string[] { "str1", "str2" };
    
  • Highlights all instances of the “str1” string in the “Column1” and the “str2” string in the “Column2” among the filtered items.

    
    e.CustomHighlighting = new Dictionary<string, string>() {
        { "Column1", "str1" },
        { "Column2", "str2" }
    };
    
  • Highlights all instances of the “str1” and “str2” strings in the “Column1” and the “str3” and “str4” strings in the “Column2” among the filtered items.

    
    e.CustomHighlighting = new Dictionary<string, string[]>() {
        { "Column1", new string[] {"str1", "str2" } },
        { "Column2", new string[] { "str3", "str4" } }
    };
    

The following code snippets illustrate how to specify the CustomHighlighting property using the regular expression. Set the ListEditCustomHighlighting.StringToRegularExpression property to true to convert the specified string into the regular expression on the client side. Otherwise, the editor will perceive this regular expression as a string.

Note

Note that the CustomHighlighting property cannot be specified as the regular expression for the String array (string[]) and Dictionary with String array as a value (Dictionary<string, string[]>).

  • Highlights the “text” string followed by one or more occurrences of the “a”, “b” and “c” letters among the filtered items.

    
    e.CustomHighlighting = "text[a-c]+";
    e.CustomHighlighting.StringToRegularExpression = true;
    
  • Highlights the “text” string followed by one or more occurrences of the “a”, “b” and “c” letters in the “Column1” and the number “50” followed by digits between 0 and 9 in the “Column2” among the filtered items.

    
    e.CustomHighlighting = new Dictionary<string, string>() { { "Column1", "text[a-c]+" }, { "Column2", "50[0-9]" } }
    e.CustomHighlighting.StringToRegularExpression = true;
    
See Also