Limit the columns of a table

Hi

I am currently working on setting up a table and I am encountering a display behavior that I cannot figure out.

I have a list of elements defined as shown in PJ model .cs. These elements contain data that I don't want to display in my table but that I need to generate templates. But when I generate my table, each data of my element creates a column. In my view I have specified the columns to be displayed (see PJ).

Do you have a solution to display only what is in my table?

The project is a web projet in Framework 4.6, the nuget pacakges are in version 19.2.0.62

Thanks


Attachment: Sample_81cb17fd.zip

7 Replies

BS Balaji Sekar Syncfusion Team October 11, 2021 03:53 AM UTC

Hi Chaffois, 

Greetings from the Syncfusion support. 

We checked the Grid rendering the Model class instead of defined columns collections but it is working properly at our end so, please upgrade our latest Syncfusion dll version(v19.3.43) then check the same if face same problem please share the replicating sample to us that will help to validate further. 

Regards, 
Balaji Sekar. 



CQ Chaffois Quentin October 11, 2021 09:54 AM UTC

HI

I updated with the last version the nugets package, however the display remains unchanged. I still can't choose the columns to display or the cell format.


Thank



BS Balaji Sekar Syncfusion Team October 12, 2021 12:29 PM UTC

Hi Chaffois, 

Thanks for your update. 

We checked your query with provided the information and we prepared a sample based on your requirement but it is working properly. So please ensure/share the below details to us that will help to validate further. 


  1. Replicate “the Model class properties are rendering in Grid columns instead of defined the column directives” issue in above sample.
  2. You have defined ScriptManger in View.html page so, we suggest you to use this method in _Layout.cshtml.
  3. Ensure the Grid’s script file(ej2.min) is latest or old(which declared in _Layout.cshtml).

Regards, 
Balaji Sekar. 



CQ Chaffois Quentin October 12, 2021 01:12 PM UTC

Hi,


Thanks for the answer, but I can't download the sample. When I click on the link, I get a page that says I don't have access.



BS Balaji Sekar Syncfusion Team October 13, 2021 04:41 AM UTC

Hi Michael, 

Greetings from Syncfusion support. 

The access is denied for the shared sample link as it is uploaded and the users of the same can only access it. So please find the new download link for the mentioned sample below, 


Please get back to us if you require any further assistance. 

Regards, 
Balaji Sekar 



CQ Chaffois Quentin October 13, 2021 08:28 AM UTC

Thanks for the new link.

I just found where my problem comes from, I had forgotten to put .Add() at the end of the columns initialization.

Everything is working properly now.



BS Balaji Sekar Syncfusion Team October 14, 2021 05:31 AM UTC

Hi Michael, 
  
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, 
Balaji Sekar 


Loader.
Up arrow icon