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

WPF RadGridView - Seperate Context Menus for Header and Row

2 Answers 77 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Karthik
Top achievements
Rank 1
Karthik asked on 30 Jan 2012, 10:33 AM
Hi,
Could you please let me know how to create a separate context menu when user clicks on column header displaying all available columns of that grid view. using Data Table as data source for Grid view. Is there any feature , which needs to be set in order to enable the header context menu.


Also could you please let me know how to merge the footer cells and make the footer row of fixed width irrespective of number of columns and their width.

Thanks in Advance.

Regards,
Karthik.

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 31 Jan 2012, 07:38 AM
Hello Karithik,

I would recommend you to run through our demos for a reference. Considering merging of footer cells, you can try changing the style of GridViewFooterCell. Further information can be found in this forum thread.

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Karthik
Top achievements
Rank 1
answered on 31 Jan 2012, 12:37 PM
Hi Maya,

I have followed through the example in demo, but unable to succeed.

I am able to create the different context menus for Row and header. If I unchecked the column from header context menu it is not making the column invisible. Could you please let me know if anything else needs to be done apart from the code in demo application.

  foreach (GridViewColumn column in grid.Columns)
                {
                    RadMenuItem subMenu = new RadMenuItem();
subMenu.Header = column.Header;
subMenu.IsCheckable = true;
subMenu.IsChecked = true;


Binding isCheckedBinding = new Binding("IsVisible");
isCheckedBinding.Mode = BindingMode.TwoWay;
isCheckedBinding.Source = column;


                    // bind IsChecked menu item property to IsVisible column property
                    subMenu.SetBinding(RadMenuItem.IsCheckedProperty, isCheckedBinding);


                    item.Items.Add(subMenu);
                }

 
Tags
GridView
Asked by
Karthik
Top achievements
Rank 1
Answers by
Maya
Telerik team
Karthik
Top achievements
Rank 1
Share this question
or