1

I'm work with angular and kendo, I have a problem to show select all in column header. Here is my code:

app.component.html

...
<kendo-grid 
    scrollable="virtual"
    [height]=500
    [data]="data"
>
    <kendo-grid-column field="" title="No">
        <ng-template kendoGridCellTemplate let-rowIndex="rowIndex"><p>{{ rowIndex + 1 }}</p></ng-template>
    </kendo-grid-column>
    <kendo-grid-column field="item" title="{{ 'COMMON.LABEL.FUNCTION_AUTHORITY' | translate }}">
    <kendo-grid-checkbox-column field="" title="Check all" showSelectAll="true">
        <ng-template kendoGridCellTemplate let-dataItem>
            <input type="checkbox" kendoCheckBox [ngModel]="dataItem.check" />
        </ng-template>
    </kendo-grid-checkbox-column>
</kendo-grid>
...

app.component.ts

import { data} from './data';
...
data: any[] = data;
...

data.ts

export const data = [
    {name: "item1", check: true},
    {name: "item2", check: false},
    {name: "item3", check: false},
    {name: "item4", check: true},
    {name: "item5", check: true}
];

I do this code in my project but it not show select all in column header. Please help me, and sorry for my poor English.

1 Answer 1

3

Now I found answer on my question just need to remove kendoGridCellTemplate, so my code

<kendo-grid-checkbox-column field="" title="Check all" showSelectAll="true">
    <ng-template let-dataItem>
        <input type="checkbox" kendoCheckBox [ngModel]="dataItem.check" />
    </ng-template>
</kendo-grid-checkbox-column>

it work

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.