We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Customize columns to let the user choose what to show and hide?

I want to add an option to the grid for the user to customize columns , so he decides what columns to show or hide , I went (quickly) through the documentation but didn't find such option.. please tell me if this possible?
basically I want when the user click the "customize columns" button, a list of all columns appear and there is an option to show or hide beside every column.
Thanks in advance.

1 Reply

BR Balamurugan Rajaraman Syncfusion Team August 25, 2017 07:44 AM UTC

HI Mohamed, 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query “How to hide or show the GridColumn”. You can able to achieve this requirement through the IsHidden property of the GridColumn as like the below provided code sample. 
 
foreach (string ite in listview.SelectedItems) 
{ 
    bool flag = dataGrid.Columns.Any(z => z.MappingName == ite); 
    if(flag) 
    { 
        this.dataGrid.Columns[ite].IsHidden = true; 
    } 
    } 
} 
 
 
We have create the sample as per the mentioned scenario in the query and attached that sample for your reference you can able to get it from the below link 
 
 
Regards, 
Balamurugan R 


Loader.
Up arrow icon