I have a very simple grid and I do not want the user to be able to select a cell or a row and displaying the blue border. As you can see in the below screenshot the 2nd row Note column is highlighted. How can I prevent this from happening?
Here is the code for the grid:
Hi Robert,
Greetings from Syncfusion support,
Based on your query wants to prevent the selection of row/ cell. To achieve this, you can utilize the rowSelecting event. This event is triggered when selecting a row, and you can prevent the selection by setting args.cancel to true. Please refer the below code snippet, documentation and sample for more information.
|
[index.html]
function rowSelecting(args) { args.cancel=true; } |
rowSelecting: https://ej2.syncfusion.com/documentation/api/grid/#rowselecting
cellSelecting: https://ej2.syncfusion.com/documentation/api/grid/#cellselecting
Sample: https://stackblitz.com/edit/fposjc?file=index.js,index.html
If you require further assistance, please do not hesitate to contact us. We are always here to help you.
Regards,
Vikram S
@Vikram Sundararajan Thank you. Soon I will try and add this to my application. I will update this thread with my results.
Sure, we will wait to hear from you.
Hello,
I am running into the same problem with the below code in React where the suggested fix doesnt seem to work
Hi Hudson,
Greetings from Syncfusion support.
Before proceeding with the solution, we would like you to share the below details.
Regards,
Joseph I.
Hello,
I am working in React with version 25.1.38 of the syncfusion/ej2-react-grids package. The issue I am facing is that the tables generated have a border around them when clicked on. Like below, for example:
The code example that I previously provided is the entire grid rendering code using the GridComponent directly from that library. The template arguments for the columns all look like this:
and the columns are all of the following type:
Hi Hudson,
After reviewing your query, we could see that you like to disable the cell outline on selecting the row. You can achieve your requirement by using the below CSS.
Please refer the below code example:
|
<style> .e-grid .e-focused:not(.e-menu-item):not(.e-editedbatchcell) { box-shadow: 0 0 0 0px #0d6efd inset; } </style> |
Ok. I can use that, but how come the border still shows up even when selection is disabled all together with "allowSelection={false}"?
Hi Hudson,
Based on your query, the border shows up even if the selection is disabled. By default, the blue border in the cell indicates that the cell if focused, this is not related to the selection process.