Timing of autoFitColumns

Hi,


What is the timing of autoFitColumns in the grid?


We are developing with ASP.NET Core 6.0 and using the Syncfusion.EJ2.AspNet.Core (20.2.0.43) grid.

The source is partially described below.


<ejs-grid id="Grid"

          actionComplete="actionComplete"

          dataBound="dataBound"

          queryCellInfo="queryCellInfo"

          height="70vh"

          toolbar="@(new List<string>() {"Search"})"

          allowPaging="true"

          allowSelection="false"

          allowSorting="true">

    <e-grid-columns>

        <e-grid-column field="…    " headerText="…    "></e-grid-column>

       

    </e-grid-columns>

    <e-grid-searchsettings key="real"></e-grid-searchsettings>

    <e-data-manager url="/Users/AAAUrlAdaptor" adaptor="UrlAdaptor"></e-data-manager>

    <e-grid-pagesettings pageSize="20" pageSizes="@(new int[] { 20, 50, 100, 200 })"></e-grid-pagesettings>

    <e-grid-sortsettings columns="@(new List<object>() { new { field = "…     ", direction = "Ascending" } })"></e-grid-sortsettings>

</ejs-grid>


We would like to run autoFitColumns on the initial display of the view, on window resizing, on grid sorting, on search, and on paging.

I was able to accomplish the requirements except for the initial display of the view.

However, I am not sure which event should be used to execute autoFitColumns on the initial display of the view.


It seems that if I execute autoFitColumns on the dataBound event or queryCellInfo event, autoFitColumns will be executed as many times as the number of data, so it would take time to display a view with a lot of data.


I want to run autoFitColumns when the view is displayed by the user, the data is loaded into the grid, and the first page is displayed.


Is there a good way to do this?


Regards,

Pylori.


12 Replies

JC Joseph Christ Nithin Issack Syncfusion Team September 27, 2022 06:17 PM UTC

Hi Phil,


  Greetings from Synfusion support.


  Based on your query, you want to perform autoFit to the columns in the grid. You can achieve your requirement by using a flag variable using the autoFit columns.


  Please refer the below code example.


 

 

var isInitialLoad = true;

function dataBound() {

  if (isInitialLoad) {

    isInitialLoad = false;

    grid.autoFitColumns();

  }

}

 


Please get back to us for further details.


Regards,

Joseph I.



PY Pylori September 28, 2022 06:47 AM UTC

Hi,


Thank you for your response.

We were able to accomplish our original requirements, but ran into other issues.


When I click on a column to sort, the sort function arrow overlaps the text in the column.

Is there any way to resolve this?


<e-grid-column autofit=true field="Leverage" headerText="Leverage" textAlign="Right"></e-grid-column>

<e-grid-column autofit=true field="Tester" headerText="Tester" textAlign="Right"></e-grid-column>


(Unsorted)


(Ascending)


(Descending)


Regards,

Pylori.



JC Joseph Christ Nithin Issack Syncfusion Team September 29, 2022 06:47 PM UTC

Hi Pylori,


  Thanks for your update.


  We tried to reproduce the issue from our side, but we were unable to reproduce the issue. We have shared a sample for your reference.




Sample: https://stackblitz.com/edit/mntc7f?file=index.js


  Please share the following details so that we will be able to proceed further.


  • Please share the complete grid rendering code.
  • Please share a simple sample to reproduce the issue.
  • Please share the Syncfusion package version you are using.


Please get back to us for further details.


Regards,

Joseph I.



PY Pylori September 29, 2022 08:09 PM UTC

Hi,


Thank you for your response.

A sample is attached.

The arrows and column text overlap as shown below.

Thank you in advance.




Regards,

Pylori.


Attachment: sample_f57e50e1.zip


JC Joseph Christ Nithin Issack Syncfusion Team September 30, 2022 05:00 PM UTC

Hi Pylori,


  Thanks for your update.


  Currently we are validating your solution, we will provide further details on or before 4th October, 2022. We appreciate your patience until then.


Regards,

Joseph I.



JC Joseph Christ Nithin Issack Syncfusion Team October 4, 2022 07:46 PM UTC

Hi Pylori,


  We are validating your query, we will provide further details on or before Oct 6th 2022. We appreciate your patience until then.


Regards,

Joseph I.



PY Pylori October 8, 2022 11:12 AM UTC

Hi,


How is the status of the verification process?





JC Joseph Christ Nithin Issack Syncfusion Team October 8, 2022 09:06 PM UTC

Hi Pylori,



Sorry for the inconvenience caused.


  We have validated your query, we have confirmed this as a bug from our side. We will provide the issue details on 10th October 2022. We appreciate your patience until then.


Regards,

Joseph I.



JC Joseph Christ Nithin Issack Syncfusion Team October 10, 2022 08:51 PM UTC

Hi Pylori,


  Thanks for your patience.


  We have confirmed the reported scenario as a bug our side and logged a defect report for the same as “Frozen rows + filtering + no results: some rows still visible”. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and will include the defect fix in our patch release scheduled to be rolled out on 26th October, 2022. We appreciate your patience until then.


You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through the below link


Feedback: https://www.syncfusion.com/feedback/38314/when-using-autofit-sort-icon-overlaps-the-header-text-in-columns-with-right-align


Regards,

Joseph I.


Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.




PY Pylori October 12, 2022 02:12 AM UTC

Hi,


Thank you for your correspondence.

I will apply the October 26, 2022 patch release.


Regards,

Pylori.



JC Joseph Christ Nithin Issack Syncfusion Team October 12, 2022 03:21 PM UTC

Hi Pylori,


  Thanks for your update.


  We will update you as promised.


Regards,

Joseph I



JC Joseph Christ Nithin Issack Syncfusion Team November 9, 2022 04:20 PM UTC

We are glad to announce that our Essential Studio 2022 Volume 3 SP Release V20.3.0.56 is rolled out and is available for download under the following link.


https://www.syncfusion.com/forums/178709/essential-studio-2022-volume-3-service-pack-release-v20-3-0-56-is-available-for-download


In that release, we have added the fix of “When using autofit sort icon overlaps the header text in columns with right align” issue. So, please update your Syncfusion packages to the current version to get this.

Release Notes: https://ej2.syncfusion.com/aspnetcore/documentation/release-notes/20.3.56?type=all#grid

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.


Loader.
Up arrow icon