Dynamically create grid for Angular in Kendo UI


ps0604

Kendo UI for Angular has a grid that can be defined as follows:

<kendo-grid [data]="gridData" [height]="410">
            <kendo-grid-column field="ProductID" title="ID" width="40">
            </kendo-grid-column>
            <kendo-grid-column field="ProductName" title="Name" width="250">
            </kendo-grid-column>
            <kendo-grid-column field="Category.CategoryName" title="Category">
            </kendo-grid-column>
            <kendo-grid-column field="UnitPrice" title="Price" width="80">
            </kendo-grid-column>
</kendo-grid>

But what I'm trying to do is build the columns dynamically. It's just like:

var grid = new KendoGrid();
var column = new KendoGridColumn();
grid.add(column);

is it possible?

Philip

AFAIK, you can't create meshes like this.

Alternatively, you can pass generate columns ngFor.

public columns = [
    { field:'ProductID', title:'ID', width:250 },
    { field:'Category.CategoryName', title:'Category' }
];

html

<kendo-grid [data]="gridData" [height]="410">
    <kendo-grid-column
        *ngFor="let column of columns"
        [field]="column.field"
        [title]="column.title"
        [width]="column.width">
    </kendo-grid-column>
</kendo-grid>

Related


Dynamically create grid for Angular in Kendo UI

ps0604 Kendo UI for Angular has a grid that can be defined as follows: <kendo-grid [data]="gridData" [height]="410"> <kendo-grid-column field="ProductID" title="ID" width="40"> </kendo-grid-column> <kendo-grid-column field="

Dynamically create grid for Angular in Kendo UI

ps0604 Kendo UI for Angular has a grid that can be defined as follows: <kendo-grid [data]="gridData" [height]="410"> <kendo-grid-column field="ProductID" title="ID" width="40"> </kendo-grid-column> <kendo-grid-column field="

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Kendo UI Grid for Angular to dynamically reorder columns

Exquisite I have a Kendo UI for Angular and not one for JQuery, and I've been trying to see how to reorder the columns dynamically. The API allows enabling it by reordering like this: <kendo-grid [reorderable]="true"...../> But I want tp to be able to reorder

Dynamically create kendo grid columns in angular controller

Kevin I'm trying to dynamically build the structure of a kendo corner mesh. My problem is that the grid options are not known when the k-optionsproperty is evaluated , so the grid will be bound to all columns on the data source. Here is the HTML: <div kendo-gr

Kendo UI for Angular2 - How to dynamically add columns to grid

Jarreg For Grid compomemet, if I already have several columns predefined in html, but the result set can have many other columns on the predefined columns, how can I add these columns dynamically? After I retrieve the data, I don't know what these extra column

Kendo UI for Angular2 - How to dynamically add columns to grid

Jarreg For Grid compomemet, if I already have several columns predefined in html, but the result set can have many other columns on the predefined columns, how can I add these columns dynamically? After I retrieve the data, I don't know what these extra column

Kendo UI for Angular2 - How to dynamically add columns to grid

Jarreg For Grid compomemet, if I already have several columns predefined in html, but the result set can have many other columns on the predefined columns, how can I add these columns dynamically? After I retrieve the data, I don't know what these extra column

Kendo UI for Angular2 - How to dynamically add columns to grid

Jarreg For Grid compomemet, if I already have several columns predefined in html, but the result set can have many other columns on the predefined columns, how can I add these columns dynamically? After I retrieve the data, I don't know what these extra column

Kendo UI for Angular2 - How to dynamically add columns to grid

Jarreg For Grid compomemet, if I already have several columns predefined in html, but the result set can have many other columns on the predefined columns, how can I add these columns dynamically? After I retrieve the data, I don't know what these extra column

Kendo UI grid dropdown and angular

Dalton 5 I try to set custom dropdown menu in Kendo UI. I have mentioned my problem. http://dojo.telerik.com/aFIZa/13 My problem is that I don't know how to set the selected text in the template property? I want to display the text field but save the ID as a v

Kendo UI grid dropdown and angular

Dalton 5 I try to set custom dropdown menu in Kendo UI. I have mentioned my problem. http://dojo.telerik.com/aFIZa/13 My problem is that I don't know how to set the selected text in the template property? I want to display the text field but save the ID as a v

Kendo UI Web - Grid Create/Update/Delete

no time I'm having issues with Kendo UI Web and datasources. The read works fine, I've serialized the database objects with JSON and am able to view them in the grid. I need some pointers on how to make create, update and delete work. By the way, I'm using the

Create a basic data grid with Kendo UI and AngularJS

Node newbie I am trying out AngularJS. I want to show a basic kendo grid. I am trying to do this using pure directives. With that in mind, I looked into the Kendo UI/Angular JS project ( https://github.com/kendo-labs/angular-kendo ). Unfortunately, my index.ht

Kendo UI Web - Grid Create/Update/Delete

no time I'm having issues with Kendo UI Web and datasources. The read works fine, I've serialized the database objects with JSON and am able to view them in the grid. I need some pointers on how to make create, update and delete work. By the way, I'm using the

Kendo UI Web - Grid Create/Update/Delete

no time I'm having issues with Kendo UI Web and datasources. The read works fine, I've serialized the database objects with JSON and am able to view them in the grid. I need some pointers on how to make create, update and delete work. By the way, I'm using the

Kendo UI for Angular custom sorting grid columns

h3li0s I have the following column in Kendo Grid (Jquery's UI) which has a special sorting method based on customer needs. field: "daysLeft", title: "Accessible", width: 130, sortable: { compare: function (a, b, descending) { if (a.daysLeft == 'Not start