Am unable to get selected row details, instead i am getting all values.
<DataGrid
justifyContent="end"
rows={rows}
columns={columns}
pageSize={pageSize}
onPageSizeChange={(newPageSize) => setPageSize(newPageSize)}
rowsPerPageOptions={[10, 20]}
disableSelectionOnClick={true}
onRowClick={onRowSelect(rows)}
/>
const onRowSelect = (event) => {
console.log("on row click", event);
};
>Solution :
You need to pass a function to onRowClick, instead you are invoking it with all values.
onRowClick={onRowSelect}
Read more about row data in Mui Docs