How to get selected cell in multi-row selection mode?

Question

How can I get the currently selected cell with:

  • SelectionMode.Row
  • SelectionType.Multiple

I'm referring to the same cell that gets the colored CSS box-highlight in the GUI.

What I Tried

I haven't found a solution that works in all cases.

Attempt #1

It almost worked for me to use "Both" selection mode instead of "Row", and call GetSelectedRowCellIndexesAsync().  In most cases, this returns exactly one list item, the selected cell, as intended.

However, when using SHIFT-click to select multiple rows, GetSelectedRowCellIndexesAsync() returns multiple cells.  It is not possible to tell which of the cells is the one I clicked on that gets the CSS highlight.

Attempt #2

I can get the selected cell if it was the one that drops down the context menu.  But it needs to also work in the general case where there is no context menu.


1 Reply

PS Prathap Senthil Syncfusion Team October 10, 2024 04:11 PM UTC

Hi Stephen,


Greetings from Syncfusion.


We would like to inform you that it is not possible to select the cell and get the details of the selected cell while using SelectionMode.Row.


Before proceeding further, we need some more clarification about your requirement. Kindly share us the below details to proceed further.


  1. Share us the entire Grid code snippet.
  2. Share us the video demonstration of the reported issue.
  3.  It is not possible to tell which of the cells is the one I clicked on that gets the CSS highlight. -> Are you expecting to get the selected cell/ focused cell at your end.
  4. I can get the selected cell if it was the one that drops down the context menu.  But it needs to also work in the general case where there is no context menu. -> kindly elaborate this in detail. So that we will check and share the possibility in achieving your requirement.


The above requested detail will be very helpful for us to validate the reported issue at our end.


Regards,

Prathap S


Loader.
Up arrow icon