devextreme-angular icon indicating copy to clipboard operation
devextreme-angular copied to clipboard

Cell Customization of DataGrid in Angular 2

Open 14Muhammad opened this issue 10 years ago • 4 comments

Hello, How we can achieve cell customization in Angular 2 as given for angular 1 in link below: http://js.devexpress.com/Demos/WidgetsGallery/#demo/data_grid-templates-cell_customization/angular Kindly provide some demo/example for angular2 cell customization in dataGrid.

Regards, Ali

14Muhammad avatar Jul 13 '16 19:07 14Muhammad

Hello Muhammad,

If I understand you right, you'd like to use the 'onCellPrepared' event to customize dxDataGrid cells. I've just checked it and confirm that this event is not raised. It seems to be a duplicate of #14. We'll check it once it's fixed.

To subscribe to this event, you can use Angular 2 event bindings:

  <dx-data-grid (onCellPrepared)="onCellPrepared" ...></dx-data-grid>

and declare a handler in your TS file:

  onCellPrepared(e) {
    ...
  }

dxbykov avatar Jul 14 '16 15:07 dxbykov

Hi, I'm currently trying to subscribe to the onRowClick event of the dx-data-grid, the event fires but I don't get an event object (which I need to dig out some row-data), this is what I use:

<dx-data-grid ... (onRowClick)="taskGridRowClicked()" ...></dx-data-grid>

and in my ts file:

taskGridRowClicked(e) {
  ...
}

What am i getting wrong here? Thanks.

Regards Andreas

staran avatar Jul 20 '16 10:07 staran

You need to use the $event value as follows:

<dx-data-grid ... (onRowClick)="taskGridRowClicked($event)" ...></dx-data-grid>

dxbykov avatar Jul 20 '16 11:07 dxbykov

Duplicate of #14

dxbykov avatar Jul 28 '16 15:07 dxbykov