adding extra row in grid under non frozen column on tab button


Hi,
When I am pressing tab in the last column after entering any value say "6" and then press tab, it is by default adding extra row. How can I resolve it?

In cellsave method I am doing in the following way:
if (args.column.index == dataLength - 1) {  //it means last cell of the last column
return;
}

but it doesn't work




5 Replies 1 reply marked as answer

BS Balaji Sekar Syncfusion Team February 12, 2021 11:15 AM UTC

Hi Rakhi, 
 
Greetings from the Syncfusion support. 
 
Query: When I am pressing tab in the last column after entering any value say "6" and then press tab, it is by default adding extra row. How can I resolve it? 
 
By default we have provided new row adding in bottom of Grid while focus out from last cell of Grid which is default behaviour. We have prevented the new row adding in the Grid  with mentioned query using beforeBatchAdd event of Grid. 

Please refer the below code example and sample for more information. 
[app.component.ts] 
beforeBatchAdd(args) { 
    if (event.action == "tab") { 
      args.cancel = true;   // Prevent the adding a new row 
    } 
  } 
 
 
 
Please get back to us, if you need further assistance. 
 
Regards, 
Balaji Sekar 


Marked as answer

RA RakhiS February 13, 2021 12:55 AM UTC

Thanks for the reply

But still I am facing the same issue. Please have a look into the same issue once again.


BS Balaji Sekar Syncfusion Team February 15, 2021 10:17 AM UTC

Hi Rakhi, 

We checked the our previous updated sample that has been prevent the new row creating in bottom of Grid while focus out from last column of Grid cell. We have video demonstration of your query as given below. 

Please refer the below video and sample for more information. 



If still facing same issue in your end please share video demonstrate of mentioned problem to us that will help to validate further. 

Regards, 
Balaji Sekar 



RA RakhiS February 23, 2021 02:47 AM UTC

Thanks, It is working but args.cancel is showing error. And when I am using event.cancel it is not working. How the red error can be removed?


BS Balaji Sekar Syncfusion Team February 23, 2021 05:57 AM UTC

Hi Rakhi, 
 
We checked the reported query in provided sample unfortunately we are unable to reproduce the mentioned problem in our end. Since please share the below details to us that will help to validate further. 
  1. Share the replicate sample
  2. Ensure the Syncfusion package version.
  3. Video demonstration of the problem.
 
Regards, 
Balaji Sekar 


Loader.
Up arrow icon