Home Forums WPF controls Xceed DataGrid for WPF Hide the HierarchicalGroupByControl in code

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26774 |

    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.

     

    Imported from legacy forums. Posted by Michael (had 638 views)

    Xceed Support
    Member
    Post count: 5658

    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.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 1964 views)

    User (Old forums)
    Member
    Post count: 23064

    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.

    Imported from legacy forums. Posted by Michael (had 1801 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.