I want to show to users filter bar when my Datagrid component created. When my component created, Users should see Datagrid as below (as if filtering button was clicked)
The codes of the Mui Datagrid component I use are down below.
<DataGrid
rows={tableRows}
columns={tableColumns}
components={{ Toolbar: ReportRenderToolbar }}
checkboxSelection
disableRowSelectionOnClick
/>
Custom Toolbar component is:
import React from "react";
import {
GridToolbarContainer,
GridToolbarFilterButton,
} from "@mui/x-data-grid";
const ReportRenderToolbar = () => {
return (
<GridToolbarContainer>
<GridToolbarFilterButton />
</GridToolbarContainer>
);
};
export default ReportRenderToolbar;
Is there any props I can pass to <GridToolbarFilterButton />
?
And how can I show filter bar above the datagrid?