Grid Column visible=false not working

I have a sfgrid control in my web applications.I have set visible =false in grid column (for orderid column) but it's not working. Please advise how to hide column


7 Replies

VN Vignesh Natarajan Syncfusion Team November 8, 2021 09:36 AM UTC

Hi KINS,  
 
Thanks for contacting Syncfusion support.  
 
Query:” I have set visible =false in grid column (for orderid column) but it's not working. Please advise how to hide column 
 
We have prepared a sample as per your suggestion (Visible=False for OrderID column) and we are not able to reproduce the reported issue at our end. Kindly refer the below sample for your reference 
 
 
After referring the sample, if you are still facing the reported issue. Kindly get back to us with following details.  
 
  1. Share the Grid Code example along with column definition.
  2. Share the Syncfusion.Blazor NuGet package version details.
  3. Are you facing any script error / exception in browser console.
  4. If possible share a simple issue reproducible sample.
 
Above requested details will be very helpful for us to validate the reported query at our end and provide solution as early as possible.  
 
Regards, 
Vignesh Natarajan 



KI KINS November 8, 2021 12:14 PM UTC

Thanks for reply..


I have check above example, it works fine as per our requirement but when I add custom CSS, then its not working. Please check attached source code with custom css file (UIUX.css) and advise where it is problem


Attachment: DataGrid_Server_23e45c4c.zip



VN Vignesh Natarajan Syncfusion Team November 9, 2021 12:04 PM UTC

Hi KINS,  
 
Thanks for the update.  
 
Query: “but when I add custom CSS, then its not working. Please check attached source code with custom css file (UIUX.css) and advise where it is problem 
 
We are able to reproduce the reported issue at our end also while using the UIUX.css file into the application. On further validation we found that issue occur due to below highlighted CSS style. Once we commented the line , we are able to resolve the reported issue. Kindly refer the below code example.  
 
.e-grid .e-rowcell { 
       border-stylesolid; 
       border-width1px 0 0 0; 
       /*display: table-cell;*/ 
       font-size10px; 
       font-familyHelvetica !important; 
       line-height18px; 
       overflowhidden; 
       padding2px 10px; 
      /* vertical-align: middle;*/ 
       white-spacenowrap; 
       widthauto; 
   } 
 
 
Please get back to us if you have further queries. 
 
Regards, 
Vignesh Natarajan 



KI KINS November 9, 2021 12:21 PM UTC

Thanks for reply...



JP Jeevakanth Palaniappan Syncfusion Team November 10, 2021 05:21 AM UTC

Hi Kins, 

You are most welcome. Get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 



KI KINS November 10, 2021 05:25 AM UTC

Can I get value from grid hidden column value if column is visible false ??



JP Jeevakanth Palaniappan Syncfusion Team November 11, 2021 02:27 PM UTC

Hi Kins, 

You can get the record values by using the GetCurrentViewRecordsAsync method of the grid. Please refer the below API referene, sample and the code snippet for your reference 

<SfGrid @ref="Grid" DataSource="@Orders" Height="315"> 
 
@code{ 
    public List<Order> Orders { get; set; } 
    SfGrid<Order> Grid { get; set; } 
    public async Task GetValues() 
    { 
        var Records = await Grid.GetCurrentViewRecordsAsync(); 
    } 
} 



 

Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon