Welcome to the Xceed Community | Help
Community Search  
More Search Options

Hide the HierarchicalGroupByControl in code

Sort Posts: Previous Next
  •  04-17-2008, 8:07 AM Post no. 11539

    Hide the HierarchicalGroupByControl in code

    Hi everybody,

     I'm doing most of my work with the DataGridControl in C# code and not in XAML.

    So, creating a new DataGridControl in code:

    Xceed.Wpf.DataGrid.DataGridControl myGrid = new Xceed.Wpf.DataGrid.DataGridControl();

    or

    FrameworkElementFactory fef_Grid = new FrameworkElementFactory(typeof(Xceed.Wpf.DataGrid.DataGridControl));

     

    How do I hide/collapse the HierarchicalGroupByControl???

    I am creating multiple grids, so I can't create a style in my main XAML file.

    That would disable the HierarchicalGroupByControl on all my grids and not only

    on those I want to.

     

    Thanks,

    Michael Nicolai-Deutschmann.

     

  •  04-17-2008, 9:03 AM Post no. 11549 in reply to 11539

    Re: Hide the HierarchicalGroupByControl in code

    There is 2 things that could be done.

    1) Create a style in code for the HierarchicalGroupByControl, in which you set the Visibility to Collapsed, then add the Style to the newly created DataGridControl's Resources collection ( set the key as typeof( HierarchicalGroupByControl ) ). This way, the implicit style will only affect the DataGridControl in question.

    2) Create a new View instance on which you set the UseDefaultHeadersFooters property to "False", then add a new DataTemplate in its FixedHeaders for the ColumnManagerRow. Assign the View to the DataGridControl and there will be no HierarchicalGroupByControl.


    Marc Laroche
    Software Developer
    Xceed Software Inc.


    I don’t suffer from insanity, I enjoy every minute of it. - Unknown
  •  04-17-2008, 9:28 AM Post no. 11555 in reply to 11549

    Re: Hide the HierarchicalGroupByControl in code

    Thank a lot for your reply.

     

    I've tried the first option and it worked well.

     

    There seem to be more than one internal object which cannot be directly accessed by code.

    So, please consider to attach your answers to the main documentation for your WPF-Grid since

    there seem to be more people who aren't doinf everything in XAML.

    The main documentation somehow favours XAML examples. Some more C#/VB.NET examples

    would be great.

     

    CU,

    Michael.

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.