DropDown filter on DataValueField

3 posts, 0 answers
  1. Rui
    Rui avatar
    17 posts
    Member since:
    Jun 2017

    Posted 06 Nov 2017 Link to this post

    I have this dropdown

    function SomeFilter(element) {

    $(element).attr('id', "SOmething");

      dataSource: {
        transport: {
            type: "POST",
            url: "@Url.Action("SomeAction", "SomeController")"
      filter: "contains",
      highlightFirst: true,
      delay: 300,
      optionLabel: "Select Something",
      dataTextField: "dataTextField",
      dataValueField: " dataValueField ",
      select: onSelect,
      dataBound: onDataBound,
      open: onOpen

    that is a filter in my grid

    columns.Bound(e => e.SomeValue).Title("SomeTitle").Width(85).Filterable(x => x.UI("SomeFilter").Extra(false));

    So far, so good. This all works fine. What I need to need is if there is a way to do the filtering on dataValueField instead of dataTextField.

  2. Ivan Danchev
    Ivan Danchev avatar
    1582 posts

    Posted 08 Nov 2017 Link to this post

    Hi Rui,

    See this KB article, which shows how the DropDownList can be filtered by multiple fields. If in your scenario you need to filter only by the field set as dataValueField, you can set only that field (CustomerID in the linked example) in the dataSource's filters configuration:
      logic: "or",
      filters: [
          field: "CustomerID",
          operator: "contains",
          value: filterValue

    Ivan Danchev
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Rui
    Rui avatar
    17 posts
    Member since:
    Jun 2017

    Posted 08 Nov 2017 in reply to Ivan Danchev Link to this post

    Yep, I did just that. On filtering event, I have


    field: e.sender.options.dataValueField,

    operator: e.filter.operator,

    value: e.filter.value.toUpperCase()



    This works for all my filters.

Back to Top