It will clear header checkbox after grid.refresh

Hi,

As below, when I clear the reject header checkbox, and call grid refresh, it will clear both the approve and reject header checkbox



Another question:

When I want to change the grid list data, must call grid.refresh ?

it will not work only change the list data?  the data changed, but the interface not change.





3 Replies

TS Thiyagu Subramani Syncfusion Team July 2, 2021 12:52 AM UTC

Hi lorryl, 
  
Thanks for contacting Syncfusion support. 
  
Query: when I clear the reject header checkbox, and call grid refresh, it will clear both the approve and reject header checkbox 
  
By default, in EJ2 Grid we have refresh method in EJ2 Grid which is used to refresh (gridInstances.refresh()) the entire Grid. Using this method, you can refresh the Grid as per your needs and if you want to clear/refresh the header checkbox, you have to refresh it based on its state value (checked) in its event. 
  
  
If still facing the issue, please share your requirement briefly with more information. 
  
Query: When I want to change the grid list data, must call grid.refresh ? 
  
By default in EJ2 Grid, Grid will automatically refresh, If we change the dataSource of the Grid. You can change the Grid dataSource like below this.  
  
  
gridInstances.dataSource = data // it change the Grid dataSource automatically 
  
If still facing the issue, please share below details for further validation. 
  
1.  Share the exact requirement which you need to refresh the Grid separately? 
  
2. Are you refreshing the complete dataSource of the Grid or else? Explain briefly ? 
  
3. Explain your requirement briefly. 
  
4. If possible, share issue reproducing sample to us. 
  
5. From your shared code information we suspect that you are refreshing each row. So please explain briefly? 
  
Regards, 
Thiyagu S 



LO lorryl November 23, 2021 08:27 AM UTC

Hi,

When I use the grid auto fit function by click a button, the checked status in header template will auto lose.

How to avoid it?



AG Ajith Govarthan Syncfusion Team November 24, 2021 04:22 PM UTC

Hi lorryl, 

Thanks for the update. 

Based on your query, you are facing checkbox checked state change issue when you autofit the columns in your Grid application. So, we have prepared sample in that we have rendered the checkbox component in the header and found that checkbox state is getting maintained even after autofit all the columns. For your convenience, we have attached the sample, please refer them for your reference. 

Code Example: 
App.component.ts 

onClick() { 
    this.grid.autoFitColumns(); 
 


If you still face the issue, then please share the complete Grid code example including the autofit related codes in your Grid application. 

Regards, 
Ajith G. 


Loader.
Up arrow icon