Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
495
possible to enable/disable all column headers from codebehind?
posted

In the Xaml I am able to achieve removing all the headers on a page with the following code:

<Grid Name="mainGrid">

<Grid.Resources>

<Style x:Key="key1" TargetType="{x:Type igWPF:PaneHeaderPresenter}">

<Setter Property="MinHeight" Value="0"/>

<Setter Property="MaxHeight" Value="0"/>

</Style>

</Grid.Resources>

However I would like to do it programatically from the codebehind (possibly by binding the toggle to a checkbox) to allow users to decide whether or not they can see grid headers and move contentPanes within the XamDockManager

Thanks

 

 

(also, I posted the same question here: http://es.infragistics.com/community/forums/p/90496/447231.aspx#447231 without realizing that this section was a better place for it.  Please feel free to lock/remove that one, thanks).

Parents
No Data
Reply
  • 34690
    Offline posted

    Hello Christian,

    To hide and unhide the headers through code-behind, I handled the Checked and Unchecked events of the checkbox and then used Utilities.GetDescendantFromType to retrieve the PaneHeaderPresenter from each of the ContentPanes. Then, I just set the Min and Max height of these PaneHeaderPresenters to 0.

    The Unchecked handler is very much the same, except the MaxHeight gets set to something other than 0 in that one.

    To hide and unhide them through data binding to that checkbox, I wrote a Style that uses data triggers that target the checkbox’s IsChecked property. If it is true, it hides the header.

    I have attached a sample demonstrating the above. Note that in the attached sample, the Style is commented out and it is using the event handler way of achieving this functionality.

    Please let me know if you have any other questions or concerns.

    Sincerely,
    Andrew
    Developer Support I
    Infragistics Inc.
    www.infragistics.com/support

    XamDockManagerHideHeaderCodeBehindCase.zip
Children