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

Set default value in textbox - filter contains

1 Answer 5 Views
Grid
This is a migrated thread and some comments may be shown as answers.
alex
Top achievements
Rank 1
Iron
Veteran
alex asked on 12 Jan 2021, 04:52 PM

Hello, I would like to know how it is possible to insert a default value inside the column filter box at the ngOnInit of the component. I would like to dynamically pass a string type parameter that searches in the corresponding column for all the values contained in the grid datadource.

 

ngOnInit() {
  var doc = this.myService.docName();
  // set doc name in the column of kendo grid and activate filtering
}

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 14 Jan 2021, 07:38 AM

Hello Alex,

Thank you for the provided screenshot.

Setting the filters array of the State object is the right way to go when a filter value needs to be used as default. Please check this article and example for more details:

https://www.telerik.com/kendo-angular-ui/components/grid/filtering/#toc-filter-row

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
alex
Top achievements
Rank 1
Iron
Veteran
Answers by
Martin
Telerik team
Share this question
or