This is a migrated thread and some comments may be shown as answers.

How to allow end user to show or hide colums

1 Answer 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 31 Dec 2011, 04:54 AM
I am a newbie to the Telerik controls. I have a Grid and I have successfully implemented a filter but what I want to do is to let the user decided which columns to show or hide.
My first reaction was, since I already have an "Apply filter" button in a RadToolBar, was to add a RadToolBarDropDown next to it. This means having to populate the Buttons in the DropDown dynamically. But there appears to be now way to FIND the RadToolBar control. Referencing its name doesn't appear to work. I;e., the ID is RadToolBar1 but when I type this in the .cs file it's not found by the intellisense.

So I thought I must be barking up the wrong tree so I tried alternative approaches but I can't find a solution. But I find it hard to believe I am the first person to try and let the user dynamically show and hide columns. So I suspect there is a far simpler method that I am missing.

Any help pointing me in the right direction would be much appreciated.

1 Answer, 1 is accepted

Sort by
0
Martin
Top achievements
Rank 1
answered on 31 Dec 2011, 05:53 PM
I solved my own problem. I populate the RadToolBarDropDown in its OnLoad event. Then I trap the button pushes in the RadGrid's Command Event handler. Be sure to Rebind() the grid after showing a column.
Tags
Grid
Asked by
Martin
Top achievements
Rank 1
Answers by
Martin
Top achievements
Rank 1
Share this question
or