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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

132288 Aug 24,2017 09:58 AM UTC Aug 25,2017 07:44 AM UTC WPF 1
loading
Tags: SfDataGrid
Mohamed
Asked On August 24, 2017 09:58 AM UTC

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.

Balamurugan Rajaraman [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;