Show all data not scroll

How to show all data without vertical-scroll?
and can remove space behind table?

plz hep


3 Replies

RS Renugadevi Sadagoban Syncfusion Team September 13, 2021 06:09 AM UTC

Hi Nguyen, 
Greetings from syncfusion. 
SfDatagrid gets the height from the parent widget. If the parent widget or Sfdatagrid have infinite size (Width , Height), then the Datagrid will be rendered with the 300*300(width and height).  
To overcome this issue, you can set the proper width and height to the Datagrid parent widget. So, please wrap the DataGrid inside the Container and set the height based on the rows count.  

Please refer the following code snippet. 
double defaultRowHeight = 49.0; 
double defaultHeaderRowHeight = 56.0; 
  @override 
  Widget build(BuildContext context) { 
    return Scaffold( 
        appBar: AppBar( 
          title: const Text('Syncfusion Flutter DataGrid'), 
        ), 
        body: Column( 
            children: [ 
              Container( 
                  height: employees.length * defaultRowHeight + defaultHeaderRowHeight, 
                  child: _buildDataGrid()), 
            ], 
          ), 
        ); 
 
 
Please let us know if you need further assistance.  
Regards, 
Renugadevi 



ND Nguyen Duc Nghia September 13, 2021 08:12 AM UTC

Thanks for the help from syncfusion,

My problem is  solved.

Thanks so much!!



RS Renugadevi Sadagoban Syncfusion Team September 13, 2021 09:12 AM UTC

Hi Nguyen 
 
Thanks for the update.  
We are glad to know that your reported problem has been solved. Please let us know if you need any other assistance. We will be happy to assist you.  
 
Regards, 
Renugadevi  


Loader.
Up arrow icon