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

Radgrid Header Context Menu Filter option for choosing columns displayed.

6 Answers 257 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Raj
Top achievements
Rank 1
Raj asked on 13 Jan 2011, 10:04 PM
Hi,
I have many columns in my radgrid, and thus I have horizontle scrolling enabled. But, I would like to allow the user to select the columns they want to have displayed by having option on the header of a column as shown in the below link:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/headercontextfiltermenu/defaultcs.aspx

Eveything is good, but my radgrid columns are created programatically. It would be great if someone can guide me in doing this programatically in code behind file.

Thanks,
Raj

6 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 17 Jan 2011, 04:51 PM
Hi Raj,

In order to display the header context filter menu for a grid you only need to set the EnableHeaderContextMenu property. From then on, the list of the columns for hide/display should be properly filled with the columns' names no matter if the columns are created dynamically or are declarative. However, their Visible property should be set to true (its default value).

Best wishes,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Raj
Top achievements
Rank 1
answered on 18 Jan 2011, 11:50 PM
Hi lana,

Thanks for getting back. I did try those things earlier, but what happens is the options are displayed on the top of my page forcing my page to go down a bit, and then the second thing is I can't choose anything from that. I see the column names with checkbox though, but can't select anything. The second time I try it, I see only the top 2 options and no column names.

Thanks for your time.

Regards,
Raj
0
Iana Tsolova
Telerik team
answered on 19 Jan 2011, 04:52 PM
Hi Raj,

Try setting the EnableAutoScroll property of the header context menu to tru e and see if it makes any difference. You can also change its height on Page_Load or grid PreRender:

RadGrid1.HeaderContextMenu.EnableAutoScroll = true;


Kind regards,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Raj
Top achievements
Rank 1
answered on 19 Jan 2011, 08:03 PM
Hi lana,

The HeaderContextMenu's EnableAutoScroll doesn't change anything for me in this case.
Thanks for your time.

Regards,
Raj
0
Iana Tsolova
Telerik team
answered on 20 Jan 2011, 10:19 AM
Hello Raj,

What about setting the menu height in addition to enabling the auto scroll?

Best wishes,
Iana
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
David Cowan
Top achievements
Rank 1
answered on 15 Oct 2012, 08:49 PM
An ability to type column names in the flyout would be helpfull once you break 50 columns even scrolling becomes pretty unusable
Tags
Grid
Asked by
Raj
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Raj
Top achievements
Rank 1
David Cowan
Top achievements
Rank 1
Share this question
or