This is a migrated thread and some comments may be shown as answers.

Filter by text, not value

3 Answers 302 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bertha
Top achievements
Rank 1
Bertha asked on 05 Dec 2018, 07:07 PM

I am using editor and template to display column as text.  But the actual values of the column is integer.  When doing filter on this column, I want to use text.

I am using the Grid Filtering with Dynamic Default Values to achieve that.  But I want the operators only show "Starts with", not "equal to" and only 1 operator (no need for "AND".  How can I achieve that?

var divData = [{ "value": 1, "text": "Owned" }, { "value": 2, "text": "Managed" }];

{ field: "DivisionID", title: "Division", values: divData, attributes: { style: "text-align:left" }, width: "150px", editor: divDropDownEditor, template: "#=getDivName(DivisionID)#" },

Thanks.

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 06 Dec 2018, 04:53 PM
Hi Bertha,

You can use filter customization to achieve this requirement:
https://demos.telerik.com/kendo-ui/grid/filter-menu-customization

And check the City column in this dojo sample:
https://dojo.telerik.com/uREFIrOP/2

The dataValueField of the combo is set to the "text" field of the source.

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Bertha
Top achievements
Rank 1
answered on 06 Dec 2018, 07:11 PM

Your City column is type: "string".  But my City column is type: "number".  I have a table called City with ID: as number, CityName as string.  So, in grid, that City column is storing CityID, not CityName.

Can you show me an example with City as number?  Thanks.

0
Eyup
Telerik team
answered on 10 Dec 2018, 01:38 PM
Hi Bertha,

Here is the sample modified to filter numeric values:
https://dojo.telerik.com/uREFIrOP/5

The name of the column is Freight.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Bertha
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Bertha
Top achievements
Rank 1
Share this question
or