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

Not able to use NgModel in kendo dropdown list

1 Answer 3361 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Maitri
Top achievements
Rank 1
Veteran
Maitri asked on 14 May 2020, 02:50 PM

I am using Kendo dropdown list in my Angular 9 project everything is working fine but i am not able to use NgModel property to dropdown.

i am getting following error: "Can't bind to 'ngModel' since it isn't a known property of 'kendo-dropdownlist'."

1 Answer, 1 is accepted

Sort by
2
Dimiter Topalov
Telerik team
answered on 18 May 2020, 08:01 AM

Hello Maitri,

The observed error is typically caused by not importing the Angular Forms module in the same module the DropDownList is used. The other possible cause is not importing the DropDowns module, but if the DropDownList is working as expected without binding ngModel, this is not the case.

Here is a runnable example, demonstrating a DropDownList bound with ngModel:

import { NgModule }      from '@angular/core';
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
import { LabelModule } from '@progress/kendo-angular-label';

import { AppComponent }   from './app.component';

@NgModule({
  imports:      [ FormsModule, BrowserModule, BrowserAnimationsModule, DropDownsModule, LabelModule ],
  declarations: [ AppComponent ],
  bootstrap:    [ AppComponent ]
})

export class AppModule { }

https://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/forms/#toc-template-driven-forms

https://stackblitz.com/edit/angular-w4e9dz?file=app/app.component.ts

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Dave
Top achievements
Rank 1
commented on 10 Aug 2021, 09:49 PM

For others, I had "Can't bind to 'ngModel' since it isn't a known property of 'kendo-textbox'" as an error, and was trying to use template driven forms. The solution for me was to import FormsModule.

Tags
General Discussions
Asked by
Maitri
Top achievements
Rank 1
Veteran
Answers by
Dimiter Topalov
Telerik team
Share this question
or