ColumnChooser (issue with autoFitColumns)


I am running into a problem when changing the selected columns.

Here is a video showing the problem

And here is a codesandbox that shows the issue

Basically, when changing the number of columns the new columns won't appear. 

3 Replies 1 reply marked as answer

AG Ajith Govarthan Syncfusion Team June 16, 2021 04:14 PM UTC

Hi Jonathan, 
  
Thanks for contacting Syncfusion support. 
  
Query: Basically, when changing the number of columns the new columns won't appear. 
  
Based on your query you are facing columns hide issue when changing the column’s visible state with column chooser in your Grid application. So, we have modified your attached sample in that we have used the actionComplete event instead of actionBegin event. 
  
Using the actionComplete event we have called the autoFitColumns method with columnstate requestType,  which resizes the columns after completing the columns visible state change process. So, all the columns will be autofitted and showed properly in the Grid component. For your convenience we have attached the sample please refer them for your reference. 
  
Code Example: 
App.tsx 
  
      actionComplete={(args) => { 
        if (args?.requestType === "columnstate") { 
          grid?.autoFitColumns(); 
        } 
      }} 
  
  
Please get back to us if you need further assistance. 
  
Regards, 
Ajith G. 
  
 


Marked as answer

JD Jonathan De Wet June 16, 2021 09:31 PM UTC

Thanks for the fast reply :) Your solution works perfectly. 


AG Ajith Govarthan Syncfusion Team June 17, 2021 03:51 PM UTC

Hi Jonathan, 
  
Thanks for the update. 
  
We are happy to hear that your issue has been resolved. 
  
Please get back to us if you need further assistance. 
  
Regards, 
Ajith G. 
  


Loader.
Up arrow icon