How To: Custom header context menu with RadGridView for Silverlight

Friday, April 10, 2009 by Vladimir Enchev | Comments 7

Another popular feature in RadGrid for ASP.NET AJAX is header context menu and I’ve made small demo how to achieve the same in RadGridView for Silverlight:
 Untitled

Similar to the custom filter row you can enable this functionality for your grid with a single property:

<telerikGrid:RadGridView x:Name="RadGridView1" 
             telerikGridViewHeaderMenu:GridViewHeaderMenu.IsEnabled="True"
             telerik:StyleManager.Theme="Vista" />

Enjoy!

[Download]

7 Comments

  • Krlos 29 Jul 2009
      If you got this error, when you try to reproduce this example in yor own project.

    The property 'IsEnabled' does not exist on the type 'RadGridView' in the XML namespace 'clr-namespace:Telerik.Windows.Controls.GridView.HeaderMenu'.

    Try:
         Editing the project  file  with notepad : 
            SET <ThrowErrorsInValidation>true</ThrowErrorsInValidation> to False

    Hope it helps.

  • Krlos 29 Jul 2009
    After sorting the columns, they lost their context behavior

  • Vlad 30 Jul 2009
    Hi Krlos,

    Same example can be found running here however everything works as expected!
  • Brett Parkhurst 16 Mar 2010
    I looked at the example and the IsEnabled still is not recognized.

    The property 'IsEnabled' does not exist on the type 'RadGridView' in the XML namespace 'clr-namespace:Telerik.Windows.Controls.GridView.HeaderMenu'.
  • Kwame Johnson 27 Apr 2010
    Don't know if this is still an open question, but you can resolve this by adding the GetIsEnabled method to your GridViewHeader class:

    public static bool GetIsEnabled(DependencyObject dependencyObject)

    {

     

     

    return (bool)dependencyObject.GetValue(IsEnabledProperty);

    }

     

    Hope that helps.

  • Giulio 11 Jul 2011
    never managed to make it work
  • Joseph Ssenyange 27 Jul 2011
    Managed to get mine working by adding
     public bool IsEnabled
            {
                get { return GetIsEnabled(m_RadGridView); }
                set { SetIsEnabled(m_RadGridView, value); }
            }
    It just works for me.

Add comment

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