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

How can I use MaskedTextBox in Edit template of a grid?

2 Answers 308 Views
MaskedTextBox
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 09 Jul 2019, 12:57 PM
I want to use the MaskedTextBox instead of a standard textbox in an Edit template of a grid, but I cannot find an axample how to do that.

What I have is:
<kendo-grid>
    <kendo-grid-column field="description"  title="Description">
        <ng-template kendoGridEditTemplate let-dataItem="dataItem">
            <input [(ngModel)]="dataItem.description" kendoGridFocusable name="Description" class="k-textbox"/>
        </ng-template>
    </kendo-grid-column>
</kendo-grid>


When I try
<ng-template kendoGridEditTemplate let-dataItem="dataItem">
     <kendo-maskedtextbox …></kendo-maskedtextbox>
</ng-template>

then Angular logs in the console “kendo-maskedtextbox' is not a known element”, although I imported
import { InputsModule, MaskedTextBoxComponent } from '@progress/kendo-angular-inputs';


So what’s the correct syntax for the MaskedTextBox?

2 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 10 Jul 2019, 12:20 PM

I found the solution myself. My syntax was correct, I only put the import in the wrong file. It had to be in app.module.ts. 

0
Martin
Telerik team
answered on 11 Jul 2019, 07:06 AM
Hi Michael,

I am glad to hear that you have found the cause of the issue. Let me know if any further assistance is required for Kendo UI for Angular.

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