Selecting Cells in a treegrid

I am trying to select a treegrid cell in the actionbeing or keypress method. It does not seem to work in either one.

I'm using this method:

   this.treegrid.selectCell({ rowIndex: 2cellIndex: 1 }, true);

What is the correct way to select cells for this control in those m



3 Replies 1 reply marked as answer

PS Pon Selva Jeganathan Syncfusion Team August 30, 2021 02:00 PM UTC

  
Hi Zachary, 
 
Thanks for contacting Syncfusion forum 
 

Query: What is the correct way to select cells

We have checked your query by preparing sample using selectCell method. But we are unable to reproduce the issue at our end. 
 
Please refer to the below sample, 
 
After following the above reference, still faced issue please share us the following details.  
 
  1. Ensure that the selection mode is set to Cell in selectionSettings.
  2. Try to reproduce the issue on shared sample or share the issue reproducible sample.
  3. Share the details of your tree grid package version.
 
The provided information will be helpful to provide you response as early as possible.   

Regards,   
Pon selva   

Marked as answer

ZA Zachary August 30, 2021 03:23 PM UTC

Thanks for the information Pon selva. 


I've attached a sample. If you run the project in Chrome, click on the first row then click the down arrow the row is not highlighting.


Attachment: sample_7882d324.zip


PS Pon Selva Jeganathan Syncfusion Team August 31, 2021 11:32 AM UTC

Hi Zachary, 
 
Thanks for the update 
 
We have validated your sample and were able to reproduce the issue at our end. In your sample, the selectionSettings mode is set to "Cell," so when the arrow keys are pressed only the cells are selected. 
 
If you want to select a row by pressing the down arrow, set the selectionSetting mode to "Rowor else if you want both the row and cell to be selected we suggest you to use the selection mode as Both. 
 
Please refer to the below modify sample, 
 

Please refer to the below help documentation:

https://ej2.syncfusion.com/angular/documentation/treegrid/selection/#selection-mode

Please refer to the below API documentation:

https://ej2.syncfusion.com/documentation/api/treegrid/selectionSettings/#mode

Kindly get back to us for further assistance.

Regards,   
Pon selva    


Loader.
Up arrow icon