Picking and Choosing Columns with RadGridView for WinForms

Friday, May 15, 2009 by WinForms Team | Comments 4

Have you ever run into a situation where you needed to allow a user to select which columns they want to see in a grid?  If you are using the RadGridView for WinForms you don’t have to lift a finger to implement this functionality.  The Column Chooser is available for the RadGridView out of the box.  Simply bind your data and you are ready to go.  You can access the Column Chooser by right clicking on any column and selecting Column Chooser from the context menu.  The Column Chooser is displayed as a floating window next to the application. 

image image

You can now drag and drop columns from the grid to the Column Chooser and vice versa to see them removed and restored to the RadGridView.  The feature requires no code to implement.  

 image

You can open the Column Chooser programmatically, if desired, using the ShowColumnChooser method of the RadGridView.  Even better, what if you want to start off with several of the columns already removed from the RadGridView?  Well you can do that too by setting the columns IsVisible property equal to False.  This will hide the column in the grid and when the Column Chooser is opened the columns that are not visible will be displayed to select from.  If you want to make the Column Chooser inaccessible through the context menu, you can set the AllowColumnChooser property equal to False.  The AllowColumnChooser property is located under the RadGridView.MasterGridViewTemplate.  This is a very nice feature that is incorporated into the RadGridView that you might not have known about.

4 Comments

  • Mark 08 Jun 2009
    Will this be available for the ajax controls as well??
  • sivakumar 25 Apr 2010
    Column chooser is good feature. 

    I have a question? Is that possible to show column chooser for both master and detail grid ? 

    In my scenario I will be having similar columns for both master and child grid. For that case I need to have common column choosing for both master and detail grid. 

    Any idea on achieving above scenario ?
  • jibran sohail 21 Sep 2010
    please tell me can it possible that when v launch application it again show our previous setting that we have done through column chooser??? i m in big trouble plz help me out
  • Nico 02 Feb 2011
    Hello,

    Just a tip:
    for those who rely on it, it might be a good idea to place a button outside the gtidview and use the:
    .showColumnChooser()

    jibran sohail:
    And to save settings, which I am about to do, you could use the "Resources" in the project, on visual studio.
      My.Settings("variableName") = 

Add comment

  1. Formatting options
       
     
     
     
     
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)