Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

267
Views
How to clear selection of checkbox from DataGrid MUI via code?

I have a delete function where it deletes an item however it doesn't unselect the item when is deleted and it won't disappear unless I manually unselect/uncheck it.

Is there a way to remove selection via code ? I tried the following from an answer but it didn't work for me:

DataGrid.UnselectAllCells()

This is what I have:

Inside my DataGrid:

checkboxSelection
        onSelectionModelChange = {(id) => {
          setSelectionModel(id);
          const selectedIDs = new Set(id);
          const selectedRowData = librosData.filter((row) =>
            selectedIDs.has(row.id)
          );
        }

OnClick for delete item

onClick={() => {
              const selectedIDs = new Set(selectionModel);
              librosData.filter((x) =>
              selectedIDs.has(x.id)).map( x => {

         ... Some code that deletes and update to firebase (working)
                DataGrid.UnselectAllCells()
                 

              })
            }}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!