We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to modify grid to be able to edit details directly without need to double click row to make it active

Thread ID:

Created:

Updated:

Platform:

Replies:

149360 Nov 22,2019 07:32 PM UTC Nov 25,2019 10:10 AM UTC Angular - EJ 2 1
loading
Tags: Grid
Tuariq
Asked On November 22, 2019 07:32 PM UTC

Team,

I need to customize the grid such that when user clicks any cell of row it directly get into edit mode
(lets say if a column is of check box type and I click on that cell, it must toggle and get updated in object model)

Can this be acheived?

Pavithra Subramaniyam [Syncfusion]
Replied On November 25, 2019 10:10 AM UTC

Hi Tuariq, 
 
Greetings from Syncfusion. 
 
You can achieve your requirement by binding click event for the Grid cells. Inside the click event you can update the row data directly or move to edit state as per your requirement.  Please refer to the below code example, documentation link and sample link for more information. 
 
[component.ts] 
@Component({ 
    selector: 'app-root', 
    template: `   <ejs-grid #grid id='Normalgrid' (click)="click($event)" [dataSource]='data' allowPaging='true'  
[pageSettings]='pageSettings' [editSettings]='editSettings' [toolbar]='toolbar'> 
            <e-columns> 
                .  .  . 
            </e-columns> 
        </ejs-grid>`, 
}) 
export class AppComponent { 
    .  .  . 
    click(e){ 
        // for normal ediitng 
      if (e.target.classList.contains("e-rowcell")) { 
            if (this.grid.isEdit) 
                this.grid.endEdit(); 
                let index: number = parseInt(e.target.getAttribute("Index")); 
                let rowData  = this.grid.currentViewData[index] as any; 
                // Update the required cell value 
                rowData.Verified = !rowData.Verified; 
                // Update the row with the modified data 
               // this.grid.updateRow(index, rowData); 
 
               // if you want the row should move to edit state please use the below code instead of updating the row 
               // this.grid.selectRow(index); 
               //this.grid.startEdit();                 
            } 
    } 
 
} 
 
 
 
                              https://ej2.syncfusion.com/angular/documentation/api/grid/edit/#updaterow 
 
 
Please get back to us if you need any further assistance on this. 
 
Regards, 
Pavithra S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon